From 8d12ade0bf5ffbf24448171066f77a0b3eaba4e5 Mon Sep 17 00:00:00 2001 From: "mr. m" <91018726+mr-cheffy@users.noreply.github.com> Date: Tue, 25 Nov 2025 17:55:05 +0100 Subject: [PATCH] fix: prevent new window when shift-clicking links in split view glance, b=closes https://github.com/zen-browser/desktop/issues/11409, p=#11424 Co-authored-by: Nihal <121309701+nihalxkumar@users.noreply.github.com> --- .../themes/shared/preferences/zen-preferences.css | 1 + src/zen/common/styles/zen-sidebar-notification.css | 2 +- src/zen/common/sys/ZenActorsManager.sys.mjs | 3 +++ src/zen/downloads/ZenDownloadAnimation.mjs | 2 +- src/zen/glance/actors/ZenGlanceChild.sys.mjs | 13 ++++++++++--- surfer.json | 2 +- 6 files changed, 17 insertions(+), 6 deletions(-) diff --git a/src/browser/themes/shared/preferences/zen-preferences.css b/src/browser/themes/shared/preferences/zen-preferences.css index c33c0f945..14bc2f65f 100644 --- a/src/browser/themes/shared/preferences/zen-preferences.css +++ b/src/browser/themes/shared/preferences/zen-preferences.css @@ -559,6 +559,7 @@ groupbox h2 { #helpButton, #support-firefox, #tabGroupSuggestions, +#web-appearance-manage-themes-link, .mission-message { display: none !important; } diff --git a/src/zen/common/styles/zen-sidebar-notification.css b/src/zen/common/styles/zen-sidebar-notification.css index 1e8a6782d..a54e6b05f 100644 --- a/src/zen/common/styles/zen-sidebar-notification.css +++ b/src/zen/common/styles/zen-sidebar-notification.css @@ -20,7 +20,7 @@ min-width: 0; border-radius: var(--border-radius-medium); box-shadow: var(--zen-sidebar-notification-shadow); - font-size: var(--font-size-medium); + font-size: 12px; } .zen-sidebar-notification-header { diff --git a/src/zen/common/sys/ZenActorsManager.sys.mjs b/src/zen/common/sys/ZenActorsManager.sys.mjs index 5208c221c..f53f80af2 100644 --- a/src/zen/common/sys/ZenActorsManager.sys.mjs +++ b/src/zen/common/sys/ZenActorsManager.sys.mjs @@ -51,6 +51,9 @@ let JSWINDOWACTORS = { keydown: { capture: true, }, + click: { + capture: true, + }, }, }, allFrames: true, diff --git a/src/zen/downloads/ZenDownloadAnimation.mjs b/src/zen/downloads/ZenDownloadAnimation.mjs index 4affc0ae8..f205d80b8 100644 --- a/src/zen/downloads/ZenDownloadAnimation.mjs +++ b/src/zen/downloads/ZenDownloadAnimation.mjs @@ -2,7 +2,6 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. -import { Downloads } from 'resource://gre/modules/Downloads.sys.mjs'; import { nsZenDOMOperatedFeature, nsZenMultiWindowFeature, @@ -24,6 +23,7 @@ class nsZenDownloadAnimation extends nsZenDOMOperatedFeature { async #setupDownloadListeners() { try { + const Downloads = window.Downloads; const list = await Downloads.getList(Downloads.ALL); list.addView({ onDownloadAdded: this.#handleNewDownload.bind(this), diff --git a/src/zen/glance/actors/ZenGlanceChild.sys.mjs b/src/zen/glance/actors/ZenGlanceChild.sys.mjs index 8a379f17a..7d39efdc9 100644 --- a/src/zen/glance/actors/ZenGlanceChild.sys.mjs +++ b/src/zen/glance/actors/ZenGlanceChild.sys.mjs @@ -86,14 +86,21 @@ export class ZenGlanceChild extends JSWindowActorChild { this.contentWindow.addEventListener('mousemove', this.mousemoveCallback, { once: true }); } - on_mouseup(event) { + on_mouseup() { + if (this.#glanceTarget) { + // Don't clear the glance target here, we need it in the click handler + // See issue https://github.com/zen-browser/desktop/issues/11409 + this.#openGlance(this.#glanceTarget); + } + this.contentWindow.removeEventListener('mousemove', this.mousemoveCallback); + } + + on_click(event) { if (this.#glanceTarget) { event.preventDefault(); event.stopPropagation(); - this.#openGlance(this.#glanceTarget); this.#glanceTarget = null; } - this.contentWindow.removeEventListener('mousemove', this.mousemoveCallback); } mousemoveCallback() { diff --git a/surfer.json b/surfer.json index 2837916e8..1ce7d9305 100644 --- a/surfer.json +++ b/surfer.json @@ -19,7 +19,7 @@ "brandShortName": "Zen", "brandFullName": "Zen Browser", "release": { - "displayVersion": "1.17.9b", + "displayVersion": "1.17.10b", "github": { "repo": "zen-browser/desktop" },