tor-browser

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

commit e98b1b1e869dc828ce6637b58c67a77dd865c67a
parent d2389bab99e12242062a993ae9e5a0c2c3573530
Author: Henrik Skupin <mail@hskupin.info>
Date:   Tue,  9 Dec 2025 14:06:19 +0000

Bug 1944568 - [remote] Don't try to handle navigations for browsing contexts in the parent process. r=jdescottes

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

Diffstat:
Mremote/shared/NavigationManager.sys.mjs | 12++++++------
Mremote/shared/js-process-actors/WebDriverDocumentInsertedParent.sys.mjs | 6+++++-
2 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/remote/shared/NavigationManager.sys.mjs b/remote/shared/NavigationManager.sys.mjs @@ -325,12 +325,13 @@ class NavigationRegistry extends EventEmitter { } /** - * Called when a navigation-committed event is recorded from the - * WebProgressListener actors. + * Called when a `document-inserted` event is recorded from the + * WebDriverDocumentInserted actors. * * This entry point is only intended to be called from - * WebProgressListenerParent, to avoid setting up observers or listeners, - * which are unnecessary since NavigationManager has to be a singleton. + * WebDriverDocumentInsertedParent, to avoid setting up + * observers or listeners, which are unnecessary since + * NavigationManager has to be a singleton. * * @param {object} data * @param {BrowsingContextDetails} data.contextDetails @@ -347,7 +348,6 @@ class NavigationRegistry extends EventEmitter { const context = this.#getContextFromContextDetails(contextDetails); const navigableId = lazy.NavigableManager.getIdForBrowsingContext(context); - const navigation = this.#navigations.get(navigableId); if (!navigation) { @@ -668,7 +668,7 @@ class NavigationRegistry extends EventEmitter { return contextDetails.context; } - return contextDetails.isTopBrowsingContext + return contextDetails.isContent && contextDetails.isTopBrowsingContext ? BrowsingContext.getCurrentTopByBrowserId(contextDetails.browserId) : BrowsingContext.get(contextDetails.browsingContextId); } diff --git a/remote/shared/js-process-actors/WebDriverDocumentInsertedParent.sys.mjs b/remote/shared/js-process-actors/WebDriverDocumentInsertedParent.sys.mjs @@ -20,7 +20,11 @@ export class WebDriverDocumentInsertedParent extends JSProcessActorParent { switch (name) { case "WebDriverDocumentInsertedChild:documentInserted": { - lazy.notifyNavigationCommitted(payload); + if (data.contextDetails.isContent) { + // There are no navigations in the parent process. + lazy.notifyNavigationCommitted(payload); + } + break; } default: