I want to inspect Firefox search bar popup window with Inspector by using Ctrl+Alt+Shift+I keys. But looks like impossible due to focus lost event. Is there some other method?
3 Answers
The focus issue has an official workaround:
It's hard to debug popups, because the browser hides them as soon as you click outside them. There is a way to disable this behavior. Click the toolbox menu and select Disable popup auto-hide.
Also note that:
This change is not persistent across browser restarts. When you close the browser toolbox, the setting will be cleared.
-
2Also in
about:config
there is a methodui.popup.disable_autohide
. Jul 29, 2019 at 11:27
Once you "Disable Popup Auto-Hide", you also need to switch context to the popup.html from background.html. I was not able to find the button to do this for quite some time. So here is the details for anyone facing same issue (reference - https://stackoverflow.com/a/39583033/6908282):
You can debug popups now. MDN explains it well; in brief...
enter
about:debugging
in the URL bar.In the left-hand menu, click This Firefox (or This Nightly).
click Inspect next to your extension to open the "Extension Toolbox".
Check the option to "Disable Popup Auto-Hide" in the Extension Toolbox
then you select which HTML document you mean to debug (in this case it would be your popup HTML code) using the context switcher ("select an iframe as the currently targeted document")
After doing this, the popup stays on the screen and the inspector contains its HTML. I'm doing it now for the first time (in Firefox 49) and it's working well.
For another option, you can have the Popup link to itself. For example, add this to the Popup HTML:
<a target="_blank" href="popup.html">Popup</a>
This will open the Popup in a new tab, that way it stays open.