Open Bug 1807805 Opened 2 years ago Updated 2 years ago

Add a local build-only toolbar button to open the Browser Toolbox and disable popup auto-hide

Categories

(DevTools :: Framework, enhancement)

enhancement

Tracking

(Not tracked)

People

(Reporter: aminomancer, Unassigned)

References

Details

Proposal to add a toolbar button (only for local builds) to the customizable UI that can open the Browser Toolbox and toggle popup auto-hide. It would make these features faster/less cumbersome for us to access, so development would be more efficient and pleasant.

Problem:

The current shortcut to open the Browser Toolbox is Accel+Alt+Shift+I. It requires 2 hands for most keyboard layouts and pressing all 3 modifiers at once can be pretty uncomfortable. But the combination itself makes sense, and having a different shortcut for local builds wouldn't be a great solution. There are other ways to access the Browser Toolbox, but they're behind multiple clicks (Tools menu bar > Browser Tools > Browser Toolbox; or App menu > More tools > Browser Toolbox)

As for the popup auto-hide feature (ui.popup.disable_autohide), it's only exposed through the Browser Toolbox itself, so you have to open the Browser Toolbox, open the meatball menu, and click the menu item for it.


My solution so far:

I made a toolbar button (i.e. a customizable widget) to fill this need for my own use and have been using it for a while. It's sort of unconventional - left click opens a browser content toolbox on the active tab (same as Accel+Shift+I), right click opens a browser toolbox (Accel+Alt+Shift+I), and middle click toggles popup auto-hide. It has a different icon depending on whether auto-hide is enabled/disabled. It has a badge to show whether a browser toolbox is already inspecting the process.

Another nice feature is that right-clicking it twice shows a popup hint that a toolbox is already running instead of trying to open a second one. Currently if you try to open the Browser Toolbox by any means while one is already open, nothing will happen for several seconds, and then a confusing "Close Firefox" prompt will appear, saying "Firefox is already running, but is not responding. The old Firefox process must be closed to open a new window." And if you focus a window (i.e. the chrome window) in the lengthy time between hitting the shortcut and the prompt appearing, the prompt will appear behind the window and you probably won't notice it for a while, by which time you no longer know what the prompt refers to, since the copy is not specific to Browser Toolbox. (it's worth short circuiting that for the other entry points too)

I also added a feature where it automatically enables popup auto-hide when opening a Browser Toolbox and automatically disables popup auto-hide when it closes. This isn't really related to the button though — it listens for toolboxes opening and closing, so that behavior works for the keyboard shortcut and menu items too. That's likely a separate issue but sort of in the same orbit as this one.


Ideas:

Some of those features are a bit opinionated/weird so I expect the final button would be a bit different. As far as I'm aware we don't have any toolbar buttons with special right/middle click behavior. And of course right-click is needed to open the context menu on the button. I worked around that by ignoring right clicks if any modifier key is held down, mimicking Firefox's behavior with respect to right clicking in web content that might capture such inputs. But that's also unconventional. So maybe this could be a combined toolbaritem like the cut/copy/paste button set.

The current icons don't match the proton refresh. I've been using the built-in command-noautohide.svg and some random toolbox icon I found on the internet which really doesn't match. Not the end of the world since it would only exist in local builds, but I would design new ones (formerly a graphic designer) that match.

We have something kind of analogous - we add the #developer-button to the default nav-bar placements for Developer Edition. That button still exists in other builds though. This could be the same kind of thing of course, but I don't think it makes sense to make the button available in official builds, 1) because the core function (opening the Browser Toolbox) will have no effect unless a pref is set, and 2) because it would be too easy for a user to accidentally disable popup auto-hide and not know how to reset it. And having all your popups stay open would be an absolute nightmare, and there probably aren't any useful google results on how to resolve such a situation, since the pref is currently tucked away in the Browser Toolbox itself. However, I suppose some Developer Edition users might find it helpful, so it's worth consideration.

There's also precedent for adding local build-only shortcuts for development purposes (see bug 1385452). We might even be able to use the existing development helpers script for this, though it would also require changes to DevToolsStartup and devtools Actor (so the button can listen to Browser Toolbox starting/ending).

The Bugbug bot thinks this bug should belong to the 'DevTools::Framework' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: General → Framework
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.