coomdev
2 years ago
15 changed files with 185 additions and 20 deletions
@ -0,0 +1,11 @@ |
|||||
|
// This is injected ASAP on 4chan to prevent 4chanX from adding a CSP
|
||||
|
// meta tag that prevents the Background WebWorker from running
|
||||
|
|
||||
|
const ocreate = document.createElement.bind(document); |
||||
|
|
||||
|
document.createElement = (tag) => { |
||||
|
if (tag != "meta") |
||||
|
return ocreate(tag); |
||||
|
document.createElement = ocreate; // restore
|
||||
|
return document.createElement('link'); // whatever to not make 4chanX crash
|
||||
|
}; |
@ -0,0 +1,29 @@ |
|||||
|
//debugger;
|
||||
|
//console.error("LOADING");
|
||||
|
chrome.scripting.registerContentScripts( |
||||
|
[{ |
||||
|
runAt: "document_start", |
||||
|
world: "MAIN", |
||||
|
js: ["4chan-x-prevent-csp-inject.js"], |
||||
|
id: "0", |
||||
|
matches: [ |
||||
|
"https://boards.4chan.org/*", |
||||
|
"https://boards.4channel.org/*" |
||||
|
] |
||||
|
}] |
||||
|
); |
||||
|
|
||||
|
chrome.scripting.updateContentScripts( |
||||
|
[{ |
||||
|
runAt: "document_start", |
||||
|
world: "MAIN", |
||||
|
js: ["4chan-x-prevent-csp-inject.js"], |
||||
|
id: "0", |
||||
|
matches: [ |
||||
|
"https://boards.4chan.org/*", |
||||
|
"https://boards.4channel.org/*" |
||||
|
] |
||||
|
}] |
||||
|
); |
||||
|
|
||||
|
//console.error("LOADED");
|
@ -1 +1,38 @@ |
|||||
export let Buffer = require("buffer").Buffer; |
export let Buffer = require("buffer").Buffer; |
||||
|
|
||||
|
if (!isBackground) { |
||||
|
|
||||
|
if (execution_mode == "userscript") { |
||||
|
const ocreate = unsafeWindow.document.createElement.bind(document); |
||||
|
|
||||
|
unsafeWindow.document.createElement = (tag) => { |
||||
|
if (tag != "meta") |
||||
|
return ocreate(tag); |
||||
|
unsafeWindow.document.createElement = ocreate; // restore
|
||||
|
return unsafeWindow.document.createElement('link'); // whatever to not make 4chanX crash
|
||||
|
}; |
||||
|
} |
||||
|
|
||||
|
if (execution_mode == "ff_api") { |
||||
|
if (typeof cloneInto != "undefined") |
||||
|
console.log("CLONE INTO DEFINED"); |
||||
|
else |
||||
|
console.log("CLONE INTO NOT DEFINED"); |
||||
|
let a = 1; |
||||
|
console.log(a++); |
||||
|
const unsafeWindow = window; |
||||
|
//const ogdoc = window.wrappedJSObject.document;
|
||||
|
console.log(a++); |
||||
|
const ocreate = unsafeWindow.document.createElement.bind(document); |
||||
|
|
||||
|
console.log(a++); |
||||
|
exportFunction((tag) => { |
||||
|
if (tag != "meta") |
||||
|
return ocreate(tag); |
||||
|
unsafeWindow.document.createElement = ocreate; // restore
|
||||
|
return unsafeWindow.document.createElement('link'); // whatever to not make 4chanX crash
|
||||
|
}, window.document, { defineAs: 'createElement' }); |
||||
|
|
||||
|
console.log(a++); |
||||
|
} |
||||
|
} |
||||
|
File diff suppressed because one or more lines are too long
@ -1 +1 @@ |
|||||
{"addons":{"{34ac4994-07f2-44d2-8599-682516a6c6a6}":{"updates":[{"version":"0.322","update_link":"https://git.coom.tech/fuckjannies/lolipiss/raw/branch/%E4%B8%AD%E5%87%BA%E3%81%97/pngextraembedder-0.322.xpi"}]}}} |
{"addons":{"{34ac4994-07f2-44d2-8599-682516a6c6a6}":{"updates":[{"version":"0.323","update_link":"https://git.coom.tech/fuckjannies/lolipiss/raw/branch/%E4%B8%AD%E5%87%BA%E3%81%97/pngextraembedder-0.323.xpi"}]}}} |
Loading…
Reference in new issue