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>
This commit is contained in:
mr. m
2025-11-25 17:55:05 +01:00
committed by GitHub
parent 58c4533939
commit 8d12ade0bf
6 changed files with 17 additions and 6 deletions

View File

@@ -559,6 +559,7 @@ groupbox h2 {
#helpButton,
#support-firefox,
#tabGroupSuggestions,
#web-appearance-manage-themes-link,
.mission-message {
display: none !important;
}

View File

@@ -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 {

View File

@@ -51,6 +51,9 @@ let JSWINDOWACTORS = {
keydown: {
capture: true,
},
click: {
capture: true,
},
},
},
allFrames: true,

View File

@@ -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),

View File

@@ -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() {

View File

@@ -19,7 +19,7 @@
"brandShortName": "Zen",
"brandFullName": "Zen Browser",
"release": {
"displayVersion": "1.17.9b",
"displayVersion": "1.17.10b",
"github": {
"repo": "zen-browser/desktop"
},