From f6f3458611d0a4e4d85ade4a4d28e03d600f7455 Mon Sep 17 00:00:00 2001 From: Elias Fleckenstein Date: Mon, 9 May 2022 19:17:32 +0200 Subject: [PATCH] Initial commit --- README.md | 3 +++ content.js | 10 ++++++++++ manifest.json | 15 +++++++++++++++ 3 files changed, 28 insertions(+) create mode 100644 README.md create mode 100644 content.js create mode 100644 manifest.json diff --git a/README.md b/README.md new file mode 100644 index 0000000..f9c94e0 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# not your business, 4anime +Prevents 4anime from redirecting you to front page whenever devtools are opened. +Also remember to disable debugger breakpoints, or else it will still redirect you. diff --git a/content.js b/content.js new file mode 100644 index 0000000..afc0aaa --- /dev/null +++ b/content.js @@ -0,0 +1,10 @@ +const script = document.createElement("script") +script.innerHTML = "console.log = console.clear = _ => {}" + +new MutationObserver(mutations => + mutations.forEach(mutation => + mutation.addedNodes.forEach(node => { + if (node.tagName == "HEAD") + node.appendChild(script) + }))) + .observe(document, {childList: true, subtree: true}) diff --git a/manifest.json b/manifest.json new file mode 100644 index 0000000..38b593d --- /dev/null +++ b/manifest.json @@ -0,0 +1,15 @@ +{ + "manifest_version": 2, + "name": "Not your business", + "version": "1.0", + "description": "Prevents 4anime from redirecting you to front page whenever devtools are opened.", + "icons": {}, + "content_scripts": [ + { + "matches": ["*://4anime.gg/*", "*://rapid-cloud.ru/*"], + "js": ["nyb.js"], + "run_at": "document_start", + "all_frames": true + } + ] +} -- 2.44.0