summaryrefslogtreecommitdiff
path: root/ext/bg
diff options
context:
space:
mode:
Diffstat (limited to 'ext/bg')
-rw-r--r--ext/bg/context.html2
-rw-r--r--ext/bg/js/context.js20
2 files changed, 10 insertions, 12 deletions
diff --git a/ext/bg/context.html b/ext/bg/context.html
index 52645022..bd62270b 100644
--- a/ext/bg/context.html
+++ b/ext/bg/context.html
@@ -178,8 +178,6 @@
</a>
</div>
- <script src="/mixed/lib/jquery.min.js"></script>
-
<script src="/mixed/js/extension.js"></script>
<script src="/bg/js/api.js"></script>
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);
});
-}));
+});