Bug 1948811: Compare windows instead of tabs to show canvas permission prompt. a=pascalc

Each window gets the observe call once. gBrowser.selectedBrowser refers to the currently selected tab and we check against that to verify if the target browser instance is in the current window.

This patch changes it to comparing windows instead of browser instances.

Original Revision: https://phabricator.services.mozilla.com/D238974

Differential Revision: https://phabricator.services.mozilla.com/D241376
This commit is contained in:
Fatih Kilic 2025-03-17 09:07:27 +00:00
parent 2168593c4f
commit 18775393b7

View file

@ -5872,7 +5872,7 @@ var CanvasPermissionPromptHelper = {
browser = aSubject;
}
if (gBrowser.selectedBrowser !== browser) {
if (browser?.ownerGlobal !== window) {
// Must belong to some other window.
return;
}