commit b017947c95fb5fd11cc6ff83b39756016f65c18b
parent 231dfc0be26610e9d79c954b9a317f6eb758b569
Author: Thomas Wisniewski <twisniewski@mozilla.com>
Date: Fri, 9 Jan 2026 18:11:56 +0000
Bug 2009181 - be more careful when unregistering content scripts in the webcompat addon; r=ksenia,webcompat-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D278294
Diffstat:
3 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/browser/extensions/webcompat/lib/interventions.js b/browser/extensions/webcompat/lib/interventions.js
@@ -564,8 +564,11 @@ class Interventions {
const contentScripts =
this._contentScriptsPerIntervention.get(intervention);
if (contentScripts) {
- const ids = contentScripts.map(s => s.id);
- await browser.scripting.unregisterContentScripts({ ids });
+ for (const id of contentScripts.map(s => s.id)) {
+ try {
+ await browser.scripting.unregisterContentScripts({ ids: [id] });
+ } catch (_) {}
+ }
}
}
diff --git a/browser/extensions/webcompat/lib/shims.js b/browser/extensions/webcompat/lib/shims.js
@@ -353,8 +353,11 @@ class Shim {
async _unregisterContentScripts() {
if (this.shouldUseScriptingAPI) {
- const ids = this._contentScriptRegistrations;
- await browser.scripting.unregisterContentScripts({ ids });
+ for (const id of this._contentScriptRegistrations) {
+ try {
+ await browser.scripting.unregisterContentScripts({ ids: [id] });
+ } catch (_) {}
+ }
} else {
for (const registration of this._contentScriptRegistrations) {
registration.unregister();
diff --git a/browser/extensions/webcompat/manifest.json b/browser/extensions/webcompat/manifest.json
@@ -2,7 +2,7 @@
"manifest_version": 2,
"name": "Web Compatibility Interventions",
"description": "Urgent post-release fixes for web compatibility.",
- "version": "148.5.0",
+ "version": "148.6.0",
"browser_specific_settings": {
"gecko": {
"id": "webcompat@mozilla.org",