brizental pushed to branch mullvad-browser-153.4.0esr-16.0-1 at The Tor Project / Applications / Mullvad Browser
Commits:
-
4ef5a05d
by Beatriz Rizental at 2026-10-06T16:04:38-03:00
1 changed file:
Changes:
| ... | ... | @@ -304,12 +304,20 @@ this.browserAction = class extends ExtensionAPIPersistent { |
| 304 | 304 | const changeNoScriptVisibility = () => {
|
| 305 | 305 | node.hidden = Services.prefs.getBoolPref(HIDE_NO_SCRIPT_PREF, true);
|
| 306 | 306 | };
|
| 307 | - // Since we expect the NoScript widget to only be destroyed on exit,
|
|
| 308 | - // we do not set up to remove the observer.
|
|
| 309 | 307 | Services.prefs.addObserver(
|
| 310 | 308 | HIDE_NO_SCRIPT_PREF,
|
| 311 | 309 | changeNoScriptVisibility
|
| 312 | 310 | );
|
| 311 | + document.defaultView.addEventListener(
|
|
| 312 | + "unload",
|
|
| 313 | + () => {
|
|
| 314 | + Services.prefs.removeObserver(
|
|
| 315 | + HIDE_NO_SCRIPT_PREF,
|
|
| 316 | + changeNoScriptVisibility
|
|
| 317 | + );
|
|
| 318 | + },
|
|
| 319 | + { once: true }
|
|
| 320 | + );
|
|
| 313 | 321 | changeNoScriptVisibility();
|
| 314 | 322 | }
|
| 315 | 323 |