4

I opened the Developer Tools on a separate window for FireFox's pop-up window. The problem is that that pop-up window automatically closes by JavaScript after form submission and I cannot disable JavaScript itself because it needs JavaScript to submit the form.

I searched for a way to disable automatic closing of the Developer Tools on window closing, and I found this but it was for Chrome. Typing window.addEventListener('unload', function() { debugger; }) on the Console did not work. I could not find Developer tools -> "Sources" tab -> Event Listener Breakpoints -> Window -> close or Event Listener Breakpoints -> Load -> unload. The Event Listener Breakpoints panel has neither close nor unload (I typed them in the "Filter by event type").

How can I prevent Developer Tools's separate window from closing?

Damn Vegetables
  • 11,484
  • 13
  • 80
  • 135

3 Answers3

2

The unload and beforeunload events obviously got removed from the list of event listener breakpoints in Firefox 69 due to causing bugs within the Debugger panel. See https://bugzil.la/1569775 for more info.

So it seems there is currently (as of Firefox 72) no way to halt the script execution on those events and you have to wait until the aforementioned bug is fixed.

Sebastian Zartner
  • 18,808
  • 10
  • 90
  • 132
1

Adding the Event Listener

  • Load
    • load

in the Debugger allowed me to keep an OAuth popup open before close.

almereyda
  • 96
  • 4
  • 1
    This only works if the javascript call redirects the current window afaik. When the script actually closes the entire tab, this does not work. – mvreijn Sep 17 '20 at 19:28
1

I searched around a lot for this issue. Many tips do not work. A solution that did work was presented here.

This involves using about:config to set the following values:

browser.link.open_newwindow                      1
browser.link.open_newwindow.restriction          0
browser.link.open_newwindow.override.external    3

After this, the popup will open in the same window. Then, the script cannot close the window since it is not the creator.

mvreijn
  • 2,807
  • 28
  • 40