Damn linting
This commit is contained in:
parent
47c2576258
commit
c24872a57c
|
@ -1,19 +1,18 @@
|
||||||
/* global API */// msg.js
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
(() => {
|
(() => {
|
||||||
function watchForStylusButton() {
|
function watchForStylusButton() {
|
||||||
// Use 1 function so we won't have duplicate code around.
|
// Use 1 function so we won't have duplicate code around.
|
||||||
const stylusQuery = () => document.querySelector("a#stylus");
|
const stylusQuery = () => document.querySelector('a#stylus');
|
||||||
|
|
||||||
if (!stylusQuery()) {
|
if (!stylusQuery()) {
|
||||||
const stylusButtonObserver = new MutationObserver(() => {
|
const stylusButtonObserver = new MutationObserver(() => {
|
||||||
if (stylusQuery()) {
|
if (stylusQuery()) {
|
||||||
stylusButtonObserver.disconnect();
|
stylusButtonObserver.disconnect();
|
||||||
stylusQuery().remove();
|
stylusQuery().remove();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
stylusButtonObserver.observe(document.body, {childList: true, subtree: true});
|
stylusButtonObserver.observe(document.body, {childList: true, subtree: true});
|
||||||
} else {
|
} else {
|
||||||
stylusQuery().remove();
|
stylusQuery().remove();
|
||||||
}
|
}
|
||||||
|
@ -37,5 +36,5 @@
|
||||||
} else {
|
} else {
|
||||||
watchForStylusButton();
|
watchForStylusButton();
|
||||||
}
|
}
|
||||||
|
|
||||||
})()
|
})();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user