tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 00777a572262b60acd7f4a92a52ab769f4afa47d
parent f1b2c5651e16e024a97a7d3536d2d06cd3d9e86e
Author: Cristina Horotan <chorotan@mozilla.com>
Date:   Fri,  9 Jan 2026 10:52:46 +0200

Revert "Bug 2009181 - be more careful when unregistering content scripts in the webcompat addon; r=ksenia,webcompat-reviewers" for causing leaks at browser/extensions/webcompat/tests/browser/browser.toml

This reverts commit 2be6b6c7d802ce276ca383898c03b741525bacf3.

Diffstat:
Mbrowser/extensions/webcompat/lib/interventions.js | 10++--------
Mbrowser/extensions/webcompat/lib/shims.js | 10++--------
2 files changed, 4 insertions(+), 16 deletions(-)

diff --git a/browser/extensions/webcompat/lib/interventions.js b/browser/extensions/webcompat/lib/interventions.js @@ -564,14 +564,8 @@ class Interventions { const contentScripts = this._contentScriptsPerIntervention.get(intervention); if (contentScripts) { - const ids = ( - await browser.scripting.getRegisteredContentScripts({ - ids: contentScripts.map(script => script.id), - }) - )?.map(script => script.id); - if (ids?.length) { - await browser.scripting.unregisterContentScripts({ ids }); - } + const ids = contentScripts.map(s => s.id); + await browser.scripting.unregisterContentScripts({ ids }); } } diff --git a/browser/extensions/webcompat/lib/shims.js b/browser/extensions/webcompat/lib/shims.js @@ -353,14 +353,8 @@ class Shim { async _unregisterContentScripts() { if (this.shouldUseScriptingAPI) { - const ids = ( - await browser.scripting.getRegisteredContentScripts({ - ids: this._contentScriptRegistrations, - }) - )?.map(script => script.id); - if (ids?.length) { - await browser.scripting.unregisterContentScripts({ ids }); - } + const ids = this._contentScriptRegistrations; + await browser.scripting.unregisterContentScripts({ ids }); } else { for (const registration of this._contentScriptRegistrations) { registration.unregister();