fix yomichan menu on Firefox Android
This commit is contained in:
parent
8a94d186c3
commit
e3d96eb67d
@ -26,7 +26,8 @@ function showExtensionInfo() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function setupButtonEvents(selector, command, url) {
|
function setupButtonEvents(selector, command, url) {
|
||||||
const node = document.querySelector(selector);
|
const nodes = document.querySelectorAll(selector);
|
||||||
|
for (const node of nodes) {
|
||||||
node.addEventListener('click', (e) => {
|
node.addEventListener('click', (e) => {
|
||||||
if (e.button !== 0) { return; }
|
if (e.button !== 0) { return; }
|
||||||
apiCommandExec(command, {newTab: e.ctrlKey});
|
apiCommandExec(command, {newTab: e.ctrlKey});
|
||||||
@ -43,6 +44,7 @@ function setupButtonEvents(selector, command, url) {
|
|||||||
node.target = '_blank';
|
node.target = '_blank';
|
||||||
node.rel = 'noopener';
|
node.rel = 'noopener';
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
window.addEventListener('DOMContentLoaded', () => {
|
window.addEventListener('DOMContentLoaded', () => {
|
||||||
|
Loading…
Reference in New Issue
Block a user