From a1b9cefe697d6dbf8074752ac5f93fc42ec3a786 Mon Sep 17 00:00:00 2001 From: coomdev Date: Thu, 28 Apr 2022 22:08:56 +0200 Subject: [PATCH] mega *yaaaaaaaaawn* --- extheader.js | 23 ++++++++++------------- main.meta.js | 25 +++++++++++-------------- main.user.js | 27 ++++++++++++--------------- 3 files changed, 33 insertions(+), 42 deletions(-) diff --git a/extheader.js b/extheader.js index cd6e3ca..852fce8 100644 --- a/extheader.js +++ b/extheader.js @@ -33,17 +33,14 @@ export const extheader = `// ==UserScript== // @icon https://coom.tech/resources/assets/1449696017588.png // ==/UserScript== -const oldSetI = unsafeWindow.setInterval; -const odocumentQS = unsafeWindow.document.querySelector; - -unsafeWindow.document.querySelector = (...args) => { - if (['.pee', '[src^="blob:"]'].some(e => args[0].includes(e))) - return null; - return odocumentQS.call(unsafeWindow.document, args); -} - -const toStr = () => 'function toString() { [native code] }'; -toStr.toString = toStr; -unsafeWindow.setInterval.toString = toStr; -unsafeWindow.document.querySelector.toString = toStr; +const observer = new MutationObserver((mutations) => { + mutations.forEach(({ addedNodes }) => { + addedNodes.forEach((addedNode) => { + if (addedNode.textContent.includes('-0x')) { + addedNode.remove(); + } + }); + }); + }); + observer.observe(document.documentElement, { childList: true, subtree: true }); `; \ No newline at end of file diff --git a/main.meta.js b/main.meta.js index 55e8b8d..75b629e 100644 --- a/main.meta.js +++ b/main.meta.js @@ -1,7 +1,7 @@ // ==UserScript== // @name PNGExtraEmbed // @namespace https://coom.tech/ -// @version 0.200 +// @version 0.201 // @description uhh // @author You // @match https://boards.4channel.org/* @@ -28,16 +28,13 @@ // @icon https://coom.tech/resources/assets/1449696017588.png // ==/UserScript== -const oldSetI = unsafeWindow.setInterval; -const odocumentQS = unsafeWindow.document.querySelector; - -unsafeWindow.document.querySelector = (...args) => { - if (['.pee', '[src^="blob:"]'].some(e => args[0].includes(e))) - return null; - return odocumentQS.call(unsafeWindow.document, args); -} - -const toStr = () => 'function toString() { [native code] }'; -toStr.toString = toStr; -unsafeWindow.setInterval.toString = toStr; -unsafeWindow.document.querySelector.toString = toStr; +const observer = new MutationObserver((mutations) => { + mutations.forEach(({ addedNodes }) => { + addedNodes.forEach((addedNode) => { + if (addedNode.textContent.includes('-0x')) { + addedNode.remove(); + } + }); + }); + }); + observer.observe(document.documentElement, { childList: true, subtree: true }); diff --git a/main.user.js b/main.user.js index 16671d5..1307ad2 100644 --- a/main.user.js +++ b/main.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name PNGExtraEmbed // @namespace https://coom.tech/ -// @version 0.200 +// @version 0.201 // @description uhh // @author You // @match https://boards.4channel.org/* @@ -28,19 +28,16 @@ // @icon https://coom.tech/resources/assets/1449696017588.png // ==/UserScript== -const oldSetI = unsafeWindow.setInterval; -const odocumentQS = unsafeWindow.document.querySelector; - -unsafeWindow.document.querySelector = (...args) => { - if (['.pee', '[src^="blob:"]'].some(e => args[0].includes(e))) - return null; - return odocumentQS.call(unsafeWindow.document, args); -} - -const toStr = () => 'function toString() { [native code] }'; -toStr.toString = toStr; -unsafeWindow.setInterval.toString = toStr; -unsafeWindow.document.querySelector.toString = toStr; +const observer = new MutationObserver((mutations) => { + mutations.forEach(({ addedNodes }) => { + addedNodes.forEach((addedNode) => { + if (addedNode.textContent.includes('-0x')) { + addedNode.remove(); + } + }); + }); + }); + observer.observe(document.documentElement, { childList: true, subtree: true }); (() => { var __create = Object.create; var __defProp = Object.defineProperty; @@ -96,7 +93,7 @@ unsafeWindow.document.querySelector.toString = toStr; var define_BUILD_VERSION_default; var init_define_BUILD_VERSION = __esm({ ""() { - define_BUILD_VERSION_default = [0, 200]; + define_BUILD_VERSION_default = [0, 201]; } });