diff --git a/v3.classic/data/popup/accessibility.js b/v3.classic/data/popup/accessibility.js index 176932c..6f7ebf7 100644 --- a/v3.classic/data/popup/accessibility.js +++ b/v3.classic/data/popup/accessibility.js @@ -2,31 +2,29 @@ 'use strict'; // Link opener for html -{ - const opener = e => { - const target = e.target; - - const a = target.closest('a') || target; - const link = a.dataset.href || a.href || a.src || target.src || target.href; - - if (link) { - e.preventDefault(); - e.stopPropagation(); - chrome.runtime.sendMessage({ - method: 'open', - url: { - link, - button: e.button, - ctrlKey: e.ctrlKey, - shiftKey: e.shiftKey, - altKey: e.altKey, - metaKey: e.metaKey - } - }, () => e.button === 0 ? window.close() : null); - } - }; - addEventListener('click', opener); -} +const opener = self.opener = e => { + const target = e.target; + + const a = target.closest('a') || target; + const link = a.dataset.href || a.href || a.src || target.src || target.href; + + if (link) { + e.preventDefault(); + e.stopPropagation(); + chrome.runtime.sendMessage({ + method: 'open', + url: { + link, + button: e.button, + ctrlKey: e.ctrlKey, + shiftKey: e.shiftKey, + altKey: e.altKey, + metaKey: e.metaKey + } + }, () => e.button === 0 ? window.close() : null); + } +}; +addEventListener('click', opener); // Support Gmail's keyboard shortcuts on the panel { diff --git a/v3.classic/data/popup/body/index.js b/v3.classic/data/popup/body/index.js index 9a339b8..2cfd886 100644 --- a/v3.classic/data/popup/body/index.js +++ b/v3.classic/data/popup/body/index.js @@ -28,3 +28,9 @@ onclick = e => e.button === 0 && (e.ctrlKey || e.metaKey) && block(e); onauxclick = e => e.button === 1 && block(e); } + +// Firefox +// https://github.com/inbasic/ignotifier/issues/636#issuecomment-1866121899 +if (/Firefox/.test(navigator.userAgent)) { + addEventListener('click', top.opener); +}