tor-browser

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

commit 8c928f228848c5f8457a325e32211d0ce55e28ca
parent 26a07f89c60da810c388b427beb004cd8fcb27f5
Author: Harsheet <hsohaney@mozilla.com>
Date:   Wed,  5 Nov 2025 18:40:06 +0000

Bug 1997383 - Ensure that the backup service widget's have an ownerGlobal to avoid crashes during shutdown. r=cdupuis

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

Diffstat:
Mbrowser/components/backup/actors/BackupUIChild.sys.mjs | 28+++++++++++++++-------------
1 file changed, 15 insertions(+), 13 deletions(-)

diff --git a/browser/components/backup/actors/BackupUIChild.sys.mjs b/browser/components/backup/actors/BackupUIChild.sys.mjs @@ -153,20 +153,22 @@ export class BackupUIChild extends JSWindowActorChild { this.#inittedWidgets ); for (let widget of widgets) { - if (widget.isConnected) { - const state = Cu.cloneInto(message.data.state, widget.ownerGlobal); - - const waivedWidget = Cu.waiveXrays(widget); - waivedWidget.backupServiceState = state; - //dispatch the event for the React listeners - widget.dispatchEvent( - new this.contentWindow.CustomEvent("BackupUI:StateWasUpdated", { - bubbles: true, - composed: true, - detail: { state }, - }) - ); + if (!widget.isConnected || !widget.ownerGlobal) { + continue; } + + const state = Cu.cloneInto(message.data.state, widget.ownerGlobal); + + const waivedWidget = Cu.waiveXrays(widget); + waivedWidget.backupServiceState = state; + //dispatch the event for the React listeners + widget.dispatchEvent( + new this.contentWindow.CustomEvent("BackupUI:StateWasUpdated", { + bubbles: true, + composed: true, + detail: { state }, + }) + ); } } }