diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2019-11-24 11:46:29 -0500 |
---|---|---|
committer | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2019-11-24 11:46:29 -0500 |
commit | 91c54e1853025c82b9f9e60c490c989ff7149d7d (patch) | |
tree | 5dfa4df2fb723414692670bc0c7b9ee7781baad9 /ext/bg/js | |
parent | 10b33dbd20d33b7497f500c11ad343399fc338a9 (diff) |
Remove JQuery from the context popup window
Diffstat (limited to 'ext/bg/js')
-rw-r--r-- | ext/bg/js/context.js | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/ext/bg/js/context.js b/ext/bg/js/context.js index 5bd6ada4..b288a79a 100644 --- a/ext/bg/js/context.js +++ b/ext/bg/js/context.js @@ -26,26 +26,26 @@ function showExtensionInfo() { } function setupButtonEvents(selector, command, url) { - const node = $(selector); - node.on('click', (e) => { + const node = document.querySelector(selector); + node.addEventListener('click', (e) => { if (e.button !== 0) { return; } apiCommandExec(command, {newTab: e.ctrlKey}); e.preventDefault(); - }) - .on('auxclick', (e) => { + }, false); + node.addEventListener('auxclick', (e) => { if (e.button !== 1) { return; } apiCommandExec(command, {newTab: true}); e.preventDefault(); - }); + }, false); if (typeof url === 'string') { - node.attr('href', url); - node.attr('target', '_blank'); - node.attr('rel', 'noopener'); + node.href = url; + node.target = '_blank'; + node.rel = 'noopener'; } } -$(document).ready(utilAsync(() => { +window.addEventListener('DOMContentLoaded', () => { showExtensionInfo(); apiGetEnvironmentInfo().then(({browser}) => { @@ -78,4 +78,4 @@ $(document).ready(utilAsync(() => { } }, 10); }); -})); +}); |