diff options
author | ManeraKai <manerakai@protonmail.com> | 2022-05-27 06:20:07 +0300 |
---|---|---|
committer | ManeraKai <manerakai@protonmail.com> | 2022-05-27 06:20:07 +0300 |
commit | 29729a01cfdcaf9573f9688d762c8694b3d192b3 (patch) | |
tree | 10e991ea1db7efcc1bf88b765d7af33ba2c29dc3 /src/pages/popup/popup.js | |
parent | Reverted version to 1.7 for now #274 (diff) | |
download | libredirect-29729a01cfdcaf9573f9688d762c8694b3d192b3.zip |
Added support for chromium. Fixed redirect off offline #276
Diffstat (limited to 'src/pages/popup/popup.js')
-rw-r--r-- | src/pages/popup/popup.js | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/pages/popup/popup.js b/src/pages/popup/popup.js index 824f178b..84dbab04 100644 --- a/src/pages/popup/popup.js +++ b/src/pages/popup/popup.js @@ -94,7 +94,7 @@ utils.unify(true).then(r => { if (!r) document.getElementById('unify_div').style.display = 'none'; else { const unify = document.getElementById('unify'); - unify.addEventListener("click", () => utils.unify(false, unify)); + unify.addEventListener("click", () => browser.runtime.sendMessage({ function: 'unify' })); } }) @@ -108,4 +108,14 @@ browser.storage.local.get( document.getElementById(frontend).classList.add("hide") else document.getElementById(frontend).classList.remove("hide") - }); \ No newline at end of file + } +); + +for (const a of document.getElementsByTagName('a')) { + a.addEventListener('click', e => { + if (!a.classList.includes('button')) { + browser.tabs.create({ url: a.getAttribute('href') }); + e.preventDefault(); + } + }) +} \ No newline at end of file |