4

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 3

3

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.

dropdown to disable popup hiding

Also note that:

This change is not persistent across browser restarts. When you close the browser toolbox, the setting will be cleared.

1
  • 2
    Also in about:config there is a method ui.popup.disable_autohide. Jul 29, 2019 at 11:27
2

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...

  1. enter about:debugging in the URL bar.

  2. In the left-hand menu, click This Firefox (or This Nightly).

  3. click Inspect next to your extension to open the "Extension Toolbox".

  4. Check the option to "Disable Popup Auto-Hide" in the Extension Toolbox

  5. 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")

    Context Switcher Screenshot

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.

0

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .