xiaoxiaoflood / firefox-scripts

userChromeJS / autoconfig.js and extensions
Mozilla Public License 2.0
1.02k stars 86 forks source link

status-bar.uc.js is unable to keep hold of searchbar permanently #124

Closed rgrk11 closed 2 years ago

rgrk11 commented 2 years ago

Hi @xiaoxiaoflood, thank you for your excellent work.

I am tesing status-bar.uc.js in firefox developer edition. The script works fine at the first time when I drag the searchbar into the status bar. However, the searchbar will disappear when I restart the firefox or open a new window. To get the searchbar back, I have to manually reload the script (Ctrl + Left-Click) every time when it happens.

I would like to ask if it is a bug or a limitation of the script.

xiaoxiaoflood commented 2 years ago

Status bar script doesn't do any handling of what is placed over it. It just creates the toolbar and displays status text over it by default. Everything else is managed by Firefox itself. How to remember buttons and their positions, how to place items... None of this is done by the script, it's all handled by Firefox.

Search bar is probably a special widget that needs special treatment, which status bar doesn't do.

rgrk11 commented 2 years ago

I got your point. Apart from searchbar, another useful extension, called custom button (can be found in here), also suffers from the same problem.

As a quick workaround, I've tried to reload the status bar script at the end of UC.rebuild.init(), and so far it works fine for every fresh start of firefox as expected. Unfortunately, it doesn't work for the case of opening a new window, where UC.rebuild.init() won't be called.

So I wonder if there is a proper way to receive a callback when a new window is opened.

xiaoxiaoflood commented 2 years ago

As a quick workaround, I've tried to reload the status bar script at the end of UC.rebuild.init(), and so far it works fine for every fresh start of firefox as expected. Unfortunately, it doesn't work for the case of opening a new window, where UC.rebuild.init() won't be called.

Thanks, this helped me to understand the issue.

Please, try the new version. This should be fixed now.

rgrk11 commented 2 years ago

It's perfect now. Thank you for your fix. Closing.