tor-browser

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

commit 80baf9fd1cd2634173a592eae3cbd226186109a9
parent aa49ecf770e7800d10d440e119fa9bcb2fcc2f09
Author: Mike Conley <mconley@mozilla.com>
Date:   Thu,  6 Nov 2025 15:59:07 +0000

Bug 1998419 - Skip using the ScriptPreloader cache when reading in content scripts for newtab. r=home-newtab-reviewers,maxx,rpl

This is a safe, upliftable change that gets us off of the ScriptPreloader. The next logical
step is to get rid of the noscript version of the activity-stream HTML page, and load the
scripts on the page "normally" with <script> tags. That will occur instead in bug 1998468.

Differential Revision: https://phabricator.services.mozilla.com/D271425

Diffstat:
Mbrowser/actors/AboutNewTabChild.sys.mjs | 5++++-
Mbrowser/components/extensions/test/browser/browser_ext_contentscript_sender_url.js | 10+++++-----
2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/browser/actors/AboutNewTabChild.sys.mjs b/browser/actors/AboutNewTabChild.sys.mjs @@ -58,7 +58,10 @@ export class AboutNewTabChild extends RemotePageChild { ]; for (let script of scripts) { - Services.scriptloader.loadSubScript(script, this.contentWindow); + Services.scriptloader.loadSubScriptWithOptions(script, { + target: this.contentWindow, + ignoreCache: true, + }); } } else if (event.type == "unload") { try { diff --git a/browser/components/extensions/test/browser/browser_ext_contentscript_sender_url.js b/browser/components/extensions/test/browser/browser_ext_contentscript_sender_url.js @@ -43,15 +43,15 @@ add_task(async function test_sender_url() { set: [["fission.bfcacheInParent", false]], }); - function awaitNewTab() { - return BrowserTestUtils.waitForLocationChange(gBrowser, "about:newtab"); + function awaitAboutPage() { + return BrowserTestUtils.waitForLocationChange(gBrowser, "about:robots"); } await extension.startup(); await BrowserTestUtils.withNewTab({ gBrowser }, async browser => { - let newTab = awaitNewTab(); - BrowserTestUtils.startLoadingURIString(browser, "about:newtab"); + let newTab = awaitAboutPage(); + BrowserTestUtils.startLoadingURIString(browser, "about:robots"); await newTab; BrowserTestUtils.startLoadingURIString(browser, image); @@ -61,7 +61,7 @@ add_task(async function test_sender_url() { let origin = await extension.awaitMessage("sender.origin"); is(origin, "http://mochi.test:8888", `Correct sender.origin: ${origin}`); - let wentBack = awaitNewTab(); + let wentBack = awaitAboutPage(); await browser.goBack(); await wentBack;