userchrome.js: how to get notified when tabs open and close?

I've recently started using the Tree Style Tab extension, and I'm finding it useful, but I'd like it if the list of tabs could be automatically hidden when only one tab i… (read more)

I've recently started using the Tree Style Tab extension, and I'm finding it useful, but I'd like it if the list of tabs could be automatically hidden when only one tab is open (and automatically shown when more than one tab is open).

I hoped to write an extension to do this, but opening the sidebar from an extension requires a user gesture, so I suspect I'll have to use a userchrome.js script.

From a "userchrome.js"-like environment (i.e. unsandboxed AutoConfig), I can hide and show the sidebar with `SidebarUI.hide()` and `SidebarUI.show("treestyletab_piro_sakura_ne_jp-sidebar-action")`, and I can examine the tabs open in the current window via `gBrowser.tabs`, but I can't see how to get notified when the number of tabs changes (replacing `gBrowser.tabs` with a proxy doesn't work, for example). I suppose I could just check every few seconds? That feels like a bit of a cop-out, though, and gets more and more inefficient the more windows are open.

There's an API for extensions to receive events when tabs open and close, so clearly this is possible. Where should I be looking for this functionality?

(I also don't know how I would go about unregistering an event listener (or cancelling a setInterval call!) when the window closes, assuming that's necessary to avoid leaking resources – is there an event like `chrome-document-global-created` I could listen for, but that fires during teardown of the window rather than when one is created?)

Asked by ash 6 minutes ago

Hanging problem

My laptop lost power mid-session and since then Firefox hangs after opening and becomes unresponsive. Can’t do anything on it. Troubleshoot mode does the same. Booted up … (read more)

My laptop lost power mid-session and since then Firefox hangs after opening and becomes unresponsive. Can’t do anything on it. Troubleshoot mode does the same. Booted up my computer in safe mode, no change.

I’m guessing a reinstall would fix it but I had a bunch of tabs open that I’m really trying not to lose. And I didn’t have an account to save them, I’ll rectify that after this.

Asked by jasonthe123 4 hours ago

Combining 2 Firefox accounts

I have accidentally end up with two FireFox accounts. I want to combine them, but I can't change either account to the other one because FireFox tells me that the replac… (read more)

I have accidentally end up with two FireFox accounts. I want to combine them, but I can't change either account to the other one because FireFox tells me that the replacement email/account is already in use. How do I get around this?

Asked by RJL_web1 20 hours ago

Videos won't play or show error sign

Everytime i try to watch a video it says it can't play or it just sits there buffering. Youtube works but only lower quality, but every other site i go on doesn't. Twitch… (read more)

Everytime i try to watch a video it says it can't play or it just sits there buffering. Youtube works but only lower quality, but every other site i go on doesn't. Twitch won't load, other sites show Error Code: 102630. This is only a problem on my browser on my windows pc I have. On mobile the browser works great and has no problem showing videos so it a problem for my pc browser.. I've tried all of the steps, i've updated, i checked drm and even went into config to check there. But nothing works, it still can't load videos. I have version 125.0.3 and for me it's the latest one. I even turned off all of my add-ons to check if it works or not but nothing there either. It worked before, just now the latest two months it hasn't. What can I do in order for the videos to load? Thank you for your time.

Asked by Banilemim 23 hours ago