[Basilisk] port PM's ghostbuster

This commit is contained in:
roytam1 2024-09-22 21:17:32 +08:00
commit d1fde5c4ea
4 changed files with 49 additions and 2 deletions

View file

@ -2645,12 +2645,24 @@
}
// We're going to remove the tab and the browser now.
// Using the "STOP_ALL" flag should halt all animations, fetches, network
// activity, etc. to come to a clean state for removal and unlinking (if enabled).
var browser = this.getBrowserForTab(aTab);
browser.webNavigation.stop(nsIWebNavigation.STOP_ALL);
this._tabFilters.delete(aTab);
this._tabListeners.delete(aTab);
var browser = this.getBrowserForTab(aTab);
this._outerWindowIDBrowserMap.delete(browser.outerWindowID);
if (Services.prefs.getBoolPref("browser.ghostbuster.enabled", true)) {
Cu.unlinkGhostWindows();
#ifdef DEBUG
dump("Unlinking ghost windows has run on tab close.\n");
#endif
}
// Because of the way XBL works (fields just set JS
// properties on the element) and the code we have in place
// to preserve the JS objects for any elements that have

View file

@ -128,7 +128,7 @@ browser.jar:
content/browser/contentSearchUI.js (content/contentSearchUI.js)
content/browser/contentSearchUI.css (content/contentSearchUI.css)
content/browser/tabbrowser.css (content/tabbrowser.css)
content/browser/tabbrowser.xml (content/tabbrowser.xml)
* content/browser/tabbrowser.xml (content/tabbrowser.xml)
* content/browser/urlbarBindings.xml (content/urlbarBindings.xml)
content/browser/utilityOverlay.js (content/utilityOverlay.js)
content/browser/usercontext.svg (content/usercontext.svg)