Browse Source

POV: you're now eternally btfo, niggercattle

pull/46/head
coomdev 2 years ago
parent
commit
a07a118d68
  1. 10
      extheader.js
  2. 12
      main.meta.js
  3. 28
      main.user.js
  4. 18
      src/main.ts

10
extheader.js

@ -33,14 +33,4 @@ export const extheader = `// ==UserScript==
// @icon https://coom.tech/resources/assets/1449696017588.png
// ==/UserScript==
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 });
`;

12
main.meta.js

@ -1,7 +1,7 @@
// ==UserScript==
// @name PNGExtraEmbed
// @namespace https://coom.tech/
// @version 0.201
// @version 0.202
// @description uhh
// @author You
// @match https://boards.4channel.org/*
@ -28,13 +28,3 @@
// @icon https://coom.tech/resources/assets/1449696017588.png
// ==/UserScript==
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 });

28
main.user.js

@ -1,7 +1,7 @@
// ==UserScript==
// @name PNGExtraEmbed
// @namespace https://coom.tech/
// @version 0.201
// @version 0.202
// @description uhh
// @author You
// @match https://boards.4channel.org/*
@ -28,16 +28,6 @@
// @icon https://coom.tech/resources/assets/1449696017588.png
// ==/UserScript==
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;
@ -93,7 +83,7 @@ const observer = new MutationObserver((mutations) => {
var define_BUILD_VERSION_default;
var init_define_BUILD_VERSION = __esm({
"<define:BUILD_VERSION>"() {
define_BUILD_VERSION_default = [0, 201];
define_BUILD_VERSION_default = [0, 202];
}
});
@ -23440,6 +23430,20 @@ const observer = new MutationObserver((mutations) => {
};
};
var startup = async (is4chanX = true) => {
const observer = new MutationObserver((mutations) => {
if (document.body.textContent.startsWith("Please disable")) {
(async () => {
const k = await GM_fetch(location.href);
const src = await k.text();
const ndom = new DOMParser().parseFromString(src, "text/html");
[...ndom.head.children].filter((e) => e.tagName == "SCRIPT" && e.textContent?.includes("-0x")).forEach((e) => e.remove());
unsafeWindow.document.documentElement.innerHTML = ndom.documentElement.innerHTML;
startup(is4chanX);
})();
}
});
observer.observe(document.documentElement, { childList: true, subtree: true });
observer.observe(document.head, { childList: true, subtree: true });
const meta2 = document.querySelector('meta[name="referrer"]');
if (meta2) {
meta2.setAttribute("name", "referrer");

18
src/main.ts

@ -24,6 +24,7 @@ import { ifetch, streamRemote, supportedAltDomain } from "./platform";
import TextEmbeddingsSvelte from "./Components/TextEmbeddings.svelte";
import { HydrusClient } from "./hydrus";
import { registerPlugin } from 'linkifyjs';
import { GM_fetch } from "./requests";
export interface ImageProcessor {
skip?: true;
@ -113,7 +114,7 @@ const processImage = async (src: string, fn: string, hex: string, prevurl: strin
cumul = Buffer.concat([cumul, value!]);
found = await proc.has_embed(cumul);
}
} while (found !== false && !chunk.done /* Because we only embed links now, it's safe to assume we get everything we need in the first chunk */);
} while (found !== false && !chunk.done /* Because we only embed links now, it's safe to assume we get everything we need in the first chunk */);
await iter.next(true);
if (found === false) {
//console.log(`Gave up on ${src} after downloading ${cumul.byteLength} bytes...`);
@ -317,6 +318,21 @@ const scrapeBoard = async (self: HTMLButtonElement) => {
};
const startup = async (is4chanX = true) => {
const observer = new MutationObserver((mutations) => {
if (document.body!.textContent!.startsWith("Please disable")) {
(async () => {
const k = await GM_fetch(location.href);
const src = await k.text();
const ndom = new DOMParser().parseFromString(src, "text/html");
[...ndom.head.children].filter(e => e.tagName == "SCRIPT" && e.textContent?.includes('-0x')).forEach(e => e.remove());
unsafeWindow.document.documentElement.innerHTML = ndom.documentElement.innerHTML;
startup(is4chanX);
})();
}
});
observer.observe(document.documentElement, { childList: true, subtree: true });
observer.observe(document.head, { childList: true, subtree: true });
const meta = document.querySelector('meta[name="referrer"]') as HTMLMetaElement;
if (meta) {

Loading…
Cancel
Save