aboutsummaryrefslogtreecommitdiffstats
path: root/src/pages/popup
diff options
context:
space:
mode:
authorManeraKai <manerakai@protonmail.com>2022-05-28 11:00:48 +0300
committerManeraKai <manerakai@protonmail.com>2022-05-28 11:00:48 +0300
commit456b65af823b0a62dafe4ccb1b628e56be9cd51e (patch)
tree56deea43dbb3bf2d636624351832c89fb8440216 /src/pages/popup
parentMerge branch 'master' of https://github.com/libredirect/libredirect (diff)
downloadlibredirect-456b65af823b0a62dafe4ccb1b628e56be9cd51e.zip
Fixed Unify Settings not working for localStorage. Fixed other things
Diffstat (limited to 'src/pages/popup')
-rw-r--r--src/pages/popup/popup.js15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/pages/popup/popup.js b/src/pages/popup/popup.js
index 84dbab04..73890b07 100644
--- a/src/pages/popup/popup.js
+++ b/src/pages/popup/popup.js
@@ -90,11 +90,22 @@ utils.copyRaw(true).then(r => {
}
})
+
utils.unify(true).then(r => {
if (!r) document.getElementById('unify_div').style.display = 'none';
else {
const unify = document.getElementById('unify');
- unify.addEventListener("click", () => browser.runtime.sendMessage({ function: 'unify' }));
+ unify.addEventListener("click", () =>
+ browser.runtime.sendMessage({ function: 'unify' },
+ response => {
+ if (response && response.response) {
+ const textElement = document.getElementById('unify').getElementsByTagName('h4')[0]
+ const oldHtml = textElement.innerHTML;
+ textElement.innerHTML = 'Unified';
+ setTimeout(() => textElement.innerHTML = oldHtml, 1000);
+ }
+ })
+ );
}
})
@@ -113,7 +124,7 @@ browser.storage.local.get(
for (const a of document.getElementsByTagName('a')) {
a.addEventListener('click', e => {
- if (!a.classList.includes('button')) {
+ if (!a.classList.contains('button')) {
browser.tabs.create({ url: a.getAttribute('href') });
e.preventDefault();
}