diff options
| author | Arpit Chakladar <54011232+arpitchakladar@users.noreply.github.com> | 2023-02-10 11:59:32 +0530 |
|---|---|---|
| committer | Arpit Chakladar <54011232+arpitchakladar@users.noreply.github.com> | 2023-02-10 11:59:32 +0530 |
| commit | 1caecf35a2d0ee81cedea40ccbd4ad4150bca2f8 (patch) | |
| tree | a40f29747c88a00967992b7835610e2fa3e17143 /src/scripts/block-unnecessary.ts | |
| parent | 5bee39d850e42743c2396f2a1eb2891a8c7e3ff9 (diff) | |
| download | banglar-bhumi-utils-1caecf35a2d0ee81cedea40ccbd4ad4150bca2f8.tar.gz banglar-bhumi-utils-1caecf35a2d0ee81cedea40ccbd4ad4150bca2f8.zip | |
Some minor changes.
Diffstat (limited to 'src/scripts/block-unnecessary.ts')
| -rw-r--r-- | src/scripts/block-unnecessary.ts | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/src/scripts/block-unnecessary.ts b/src/scripts/block-unnecessary.ts deleted file mode 100644 index 65d610a..0000000 --- a/src/scripts/block-unnecessary.ts +++ /dev/null @@ -1,36 +0,0 @@ -let replace: (any[] | undefined)[] = [ - ["head > script:nth-child(34)", { src: "" }], - ["head > script:nth-child(35)", { src: "https://code.jquery.com/jquery-1.12.4.min.js", crossorigin: "anonymous" }], - ["head > script:nth-child(43)", { src: "" }] -]; -let count = 0; -let notDone = true; - -const observer = new MutationObserver(() => { - if (notDone) { - const meta = document.querySelector("head > meta:nth-child(2)"); - if (meta) { - meta.setAttribute("http-equiv", "Content-Security-Policy"); - meta.setAttribute("content", "default-src 'self' data: gap: https://ssl.gstatic.com 'unsafe-eval'; style-src 'self' 'unsafe-inline'; media-src *"); - notDone = false; - } - } - for (let i = 0; i < replace.length; i++) { - if (replace[i]) { - const element = document.querySelector(replace[i]![0]) as HTMLElement | null; - if (element) { - const attributes = replace[i]![1]; - for (const attribute in attributes) { - element.setAttribute(attribute, attributes[attribute]); - } - replace[i] = undefined; - count++; - if (count >= replace.length) { - observer.disconnect(); - break; - } - } - } - } -}); -observer.observe(document, {childList: true, subtree: true}); |
