summaryrefslogtreecommitdiffstats
path: root/toolkit/modules/PopupNotifications.sys.mjs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-08 15:18:54 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-08 15:18:54 +0000
commita5f28e22cc28ca53d092f6545bc924ee43a8bbe4 (patch)
tree7e02d01734d97de08bdeed66d2d5185f8e4f0a61 /toolkit/modules/PopupNotifications.sys.mjs
parentReleasing progress-linux version 115.8.0esr-1~deb12u1progress7u1. (diff)
downloadfirefox-esr-a5f28e22cc28ca53d092f6545bc924ee43a8bbe4.tar.xz
firefox-esr-a5f28e22cc28ca53d092f6545bc924ee43a8bbe4.zip
Merging upstream version 115.9.0esr.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'toolkit/modules/PopupNotifications.sys.mjs')
-rw-r--r--toolkit/modules/PopupNotifications.sys.mjs17
1 files changed, 13 insertions, 4 deletions
diff --git a/toolkit/modules/PopupNotifications.sys.mjs b/toolkit/modules/PopupNotifications.sys.mjs
index ca51346625..0c33220174 100644
--- a/toolkit/modules/PopupNotifications.sys.mjs
+++ b/toolkit/modules/PopupNotifications.sys.mjs
@@ -309,9 +309,11 @@ export function PopupNotifications(tabbrowser, panel, iconBox, options = {}) {
);
Services.obs.addObserver(this, "fullscreen-transition-start");
+ Services.obs.addObserver(this, "pointer-lock-entered");
this.window.addEventListener("unload", () => {
Services.obs.removeObserver(this, "fullscreen-transition-start");
+ Services.obs.removeObserver(this, "pointer-lock-entered");
});
this.window.addEventListener("activate", this, true);
@@ -361,7 +363,11 @@ PopupNotifications.prototype = {
},
observe(subject, topic) {
- if (topic == "fullscreen-transition-start") {
+ // These observers apply to all windows.
+ if (
+ topic == "fullscreen-transition-start" ||
+ topic == "pointer-lock-entered"
+ ) {
// Extend security delay if the panel is open.
if (this.isPanelOpen) {
let notification = this.panel.firstChild?.notification;
@@ -1336,9 +1342,12 @@ PopupNotifications.prototype = {
n._recordTelemetryStat(TELEMETRY_STAT_OFFERED);
}, this);
- // We're about to open the panel while in a full screen transition. Extend
- // the security delay.
- if (this.window.isInFullScreenTransition) {
+ // We're about to open the panel while in a full screen transition or
+ // during pointer lock. Extend the security delay to avoid clickjacking.
+ if (
+ this.window.isInFullScreenTransition ||
+ this.window.PointerLock?.isActive
+ ) {
this._extendSecurityDelay(notificationsToShow);
}