xiaoxiaoflood / firefox-scripts

userChromeJS / autoconfig.js and extensions
Mozilla Public License 2.0
944 stars 83 forks source link

status-bar.uc.js script doesn't start #233

Open LummoxJR opened 1 year ago

LummoxJR commented 1 year ago

In Firefox 109.0b9, I saw that I had no statusbar.

This appears to be because of this line at the beginning of the script:

const { CustomizableUI, StatusPanel } = window;

As far as I can tell, that line isn't necessary for the rest of the code to work. It's causing an error when trying to run the script, which does not appear in the console window. Commenting out the line fixes the script for me.

Edit: I also discovered this is the reason for a related bug I was going to report. One of my own userscripts, which has a name that comes after s alphabetically, was not loading correctly for all windows, but an earlier userscript was. (That is, the @startup for hideOneTab.uc.js was running, but for tabsOnBottom.uc.js it didn't.) I believe the problem is here in userChrome.jsm:

    if (script.onlyonce && script.isRunning) {
      if (script.startup) {
        eval(script.startup);
      }
      return;
    }

The eval() isn't wrapped in a try/catch. If the statusbar script doesn't load, then this eval() should result in an error and prevents loadScript() from being called on subsequent scripts in the array.

mozo78 commented 1 year ago

Hello, I don't have a statusbar on 109 as well (It's working fine on 108). I tried to find this line but I can't find it anywhere. Would you like to tell me where to search? Thank you :)

Edit: Found it and it's working fine. Thank you very much!!!

rediffusion commented 1 year ago

@LummoxJR Same is here

UPD I've just updated the script, now it's working fine.

LummoxJR commented 1 year ago

And just like that, Firefox 110 appears to have re-broken it. If I uncomment the line that fixed this in the first place, it works fine again.

xiaoxiaoflood commented 1 year ago

This appears to be because of this line at the beginning of the script:


const { CustomizableUI, StatusPanel } = window;

Are you sure you're using latest userChrome.jsm? This issue is symtom of using a version before this commit: 8764048e0397ba9db174344813d674c104805560. And exactly because of that change made in userChrome.jsm, the line

  const { CustomizableUI, StatusPanel } = window;

needed to be added in the same commit to not break Status Bar (and similar lines for other scripts).

Files published here worked for me in v109, v110 and are working now in v111.

Allexedge commented 1 year ago

Firefox 102.11.0 ESR, status bar takes all available space leaving no room for actual window contents: image I use the latest version from the repository, maybe it's too new for FF 102?