aboutsummaryrefslogtreecommitdiffstats
path: root/src/pages/popup
diff options
context:
space:
mode:
authorManeraKai <manerakai@protonmail.com>2022-05-27 06:20:07 +0300
committerManeraKai <manerakai@protonmail.com>2022-05-27 06:20:07 +0300
commit29729a01cfdcaf9573f9688d762c8694b3d192b3 (patch)
tree10e991ea1db7efcc1bf88b765d7af33ba2c29dc3 /src/pages/popup
parentReverted version to 1.7 for now #274 (diff)
downloadlibredirect-29729a01cfdcaf9573f9688d762c8694b3d192b3.zip
Added support for chromium. Fixed redirect off offline #276
Diffstat (limited to 'src/pages/popup')
-rw-r--r--src/pages/popup/popup.js14
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