diff --git a/locales/en-US/browser/browser/zen-general.ftl b/locales/en-US/browser/browser/zen-general.ftl index 49fe38cf0..3cd708737 100644 --- a/locales/en-US/browser/browser/zen-general.ftl +++ b/locales/en-US/browser/browser/zen-general.ftl @@ -116,3 +116,7 @@ zen-site-data-setting-site-protection = Tracking Protection zen-site-data-panel-feature-callout-title = A new home for add-ons, permissions, and more zen-site-data-panel-feature-callout-subtitle = Click the icon to manage site settings, view security info, access extensions, and perform common actions. + +zen-open-link-in-glance = + .label = Open Link in Glance + .accesskey = G diff --git a/src/browser/base/content/nsContextMenu-sys-mjs.patch b/src/browser/base/content/nsContextMenu-sys-mjs.patch index d705ed870..b872d46b7 100644 --- a/src/browser/base/content/nsContextMenu-sys-mjs.patch +++ b/src/browser/base/content/nsContextMenu-sys-mjs.patch @@ -1,13 +1,13 @@ diff --git a/browser/base/content/nsContextMenu.sys.mjs b/browser/base/content/nsContextMenu.sys.mjs -index 259b440375c7e84d373a134fea20cdbc1c1bae4b..a9ce22a2391b4ec0bf82ceedd35f4c9d9626bb28 100644 +index 259b440375c7e84d373a134fea20cdbc1c1bae4b..c4a251f0169d22186c2766992ab40366d53582f1 100644 --- a/browser/base/content/nsContextMenu.sys.mjs +++ b/browser/base/content/nsContextMenu.sys.mjs -@@ -1104,6 +1104,8 @@ export class nsContextMenu { +@@ -1103,6 +1103,8 @@ export class nsContextMenu { + !this.onMozExtLink && !this.isSecureAboutPage() ); - + this.showItem("context-zenSplitLink", this.onLink && !this.onMailtoLink && !this.onTelLink); -+ ++ this.showItem("context-zenOpenLinkInGlance", this.onLink && !this.onMailtoLink && !this.onTelLink); + let canNotStrip = lazy.STRIP_ON_SHARE_CAN_DISABLE && !this.#canStripParams(); - diff --git a/src/zen/glance/ZenGlanceManager.mjs b/src/zen/glance/ZenGlanceManager.mjs index 52e452175..27d82b591 100644 --- a/src/zen/glance/ZenGlanceManager.mjs +++ b/src/zen/glance/ZenGlanceManager.mjs @@ -40,6 +40,7 @@ this.#setupEventListeners(); this.#setupPreferences(); this.#setupObservers(); + this.#insertIntoContextMenu(); } #setupEventListeners() { @@ -64,6 +65,17 @@ Services.obs.addObserver(this, 'quit-application-requested'); } + #insertIntoContextMenu() { + const menuitem = document.createXULElement('menuitem'); + menuitem.setAttribute('id', 'context-zenOpenLinkInGlance'); + menuitem.setAttribute('hidden', 'true'); + menuitem.setAttribute('data-l10n-id', 'zen-open-link-in-glance'); + + menuitem.addEventListener('command', () => this.openGlance({ url: gContextMenu.linkURL })); + + document.getElementById('context-sep-open').insertAdjacentElement('beforebegin', menuitem); + } + /** * Handle main command set events for glance operations * @param {Event} event - The command event