Bug 1675940 Comment 2 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

First attempt did not work. 

The reason this works in TB79+ but not in TB78 is this change introduced in bug 1353466 (TB79):
https://searchfox.org/comm-central/source/mozilla/dom/base/nsGlobalWindowOuter.cpp#6261

[TB79+] 
The added check for `!IsOnlyTopLevelDocumentInSHistory` seems to bypass the check for `allowClose` further down. That is why the value for `allowScriptsToClose` is ignored (setting it to false has now effect in TB79+).
I think that is a regression introduced by bug 1353466 (FF79+ ignores allowScriptsToClose = false)

[TB78]
manually calling `windowUtils.allowScriptsToClose()` should but does not fix it yet - still investigating
https://searchfox.org/comm-central/source/mozilla/toolkit/components/extensions/ext-browser-content.js#80
First attempt did not work. 

The reason this works in TB79+ but not in TB78 is this change introduced in bug 1353466 (TB79):
https://searchfox.org/comm-central/source/mozilla/dom/base/nsGlobalWindowOuter.cpp#6261

[TB79+] 
The added check for `!IsOnlyTopLevelDocumentInSHistory` seems to bypass the check for `allowClose` further down. That is why the value for `allowScriptsToClose` is ignored (setting it to false has no effect in TB79+).
I think that is a regression introduced by bug 1353466 (FF79+ ignores allowScriptsToClose = false)

[TB78]
manually calling `windowUtils.allowScriptsToClose()` should but does not fix it yet - still investigating
https://searchfox.org/comm-central/source/mozilla/toolkit/components/extensions/ext-browser-content.js#80
First attempt did not work. 

The reason this works in TB79+ but not in TB78 is this change introduced in bug 1353466 (TB79):
https://searchfox.org/comm-central/source/mozilla/dom/base/nsGlobalWindowOuter.cpp#6261

[TB79+] 
The added check for `!IsOnlyTopLevelDocumentInSHistory` seems to bypass the check for `allowClose` further down. That is why the value for `allowScriptsToClose` is ignored (setting it to false has no effect in TB79+).
Due to bug 1353466 FF79+ and TB79+ ignore `allowScriptsToClose = false` and always all scripts in popup windows to close themselves.

[TB78]
TB78 never called `windowUtils.allowScriptsToClose()` like FF78 did, so scripts cannot close themselves for us
https://searchfox.org/comm-central/source/mozilla/toolkit/components/extensions/ext-browser-content.js#80

The provided patch attaches `allowScriptsToClose` to the arguments passed to extensionPopup.xhtml and calls `windowUtils.allowScriptsToClose()`  for the content window if needed.

As long as the free pass introduced in bug 1353466 is not removed fro TB79+, this patch has no effect. But its needed for TB78.
First attempt did not work. 

The reason this works in TB79+ but not in TB78 is this change introduced in bug 1353466 (TB79):
https://searchfox.org/comm-central/source/mozilla/dom/base/nsGlobalWindowOuter.cpp#6261

[TB79+] 
The added check for `!IsOnlyTopLevelDocumentInSHistory` seems to bypass the check for `allowClose` further down. That is why the value for `allowScriptsToClose` is ignored (setting it to false has no effect in TB79+).
Due to bug 1353466 FF79+ and TB79+ ignore `allowScriptsToClose = false` and always all scripts in popup windows to close themselves.

[TB78]
TB78 never called `windowUtils.allowScriptsToClose()` like FF78 did, so scripts cannot close themselves for us
https://searchfox.org/comm-central/source/mozilla/toolkit/components/extensions/ext-browser-content.js#80

The provided patch attaches `allowScriptsToClose` to the arguments passed to extensionPopup.xhtml and calls `windowUtils.allowScriptsToClose()`  for the content window if needed.

As long as the free pass introduced in bug 1353466 is not removed from TB79+, this patch has no effect. But it is needed for TB78.
First attempt did not work. 

The reason this works in TB79+ but not in TB78 is this change introduced in bug 1353466 (TB79):
https://searchfox.org/comm-central/source/mozilla/dom/base/nsGlobalWindowOuter.cpp#6261

[TB79+] 
The added check for `!IsOnlyTopLevelDocumentInSHistory` seems to bypass the check for `allowClose` further down. That is why the value for `allowScriptsToClose` is ignored (setting it to false has no effect in TB79+).
Due to bug 1353466 FF79+ and TB79+ ignore `allowScriptsToClose = false` and allows all scripts in popup windows to close themselves.

[TB78]
TB78 never called `windowUtils.allowScriptsToClose()` like FF78 did, so scripts cannot close themselves for us
https://searchfox.org/comm-central/source/mozilla/toolkit/components/extensions/ext-browser-content.js#80

The provided patch attaches `allowScriptsToClose` to the arguments passed to extensionPopup.xhtml and calls `windowUtils.allowScriptsToClose()`  for the content window if needed.

As long as the free pass introduced in bug 1353466 is not removed from TB79+, this patch has no effect. But it is needed for TB78.

Back to Bug 1675940 Comment 2