feat: get rid of `Disable Tampermonkey`
This commit is contained in:
parent
2a29e378f2
commit
c11d6d2c48
10
src/file.ts
10
src/file.ts
|
@ -14,6 +14,16 @@ const TYPE_REG = /id=(\d+)&type=(img|mp3|midi)/
|
||||||
const magicHookConstr = (() => {
|
const magicHookConstr = (() => {
|
||||||
const l = {}
|
const l = {}
|
||||||
|
|
||||||
|
// get rid of `Disable Tampermonkey`
|
||||||
|
const observer = new MutationObserver((mutations) => {
|
||||||
|
mutations.forEach(x => [...x.addedNodes].forEach(e => {
|
||||||
|
if (!document.querySelector('.js-page')) {
|
||||||
|
(e as HTMLElement).replaceWith(...x.removedNodes)
|
||||||
|
}
|
||||||
|
}))
|
||||||
|
})
|
||||||
|
observer.observe(document, { childList: true, subtree: true })
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const p = Object.getPrototypeOf(document.body)
|
const p = Object.getPrototypeOf(document.body)
|
||||||
Object.setPrototypeOf(document.body, null)
|
Object.setPrototypeOf(document.body, null)
|
||||||
|
|
Loading…
Reference in New Issue