coomdev
1 year ago
10 changed files with 96 additions and 75 deletions
@ -0,0 +1,22 @@ |
|||
const filts = { |
|||
urls: ["https://desuarchive.org/*", |
|||
"https://arch.b4k.co/*", |
|||
"https://kohlchan.net/*" |
|||
], |
|||
types: ["main_frame", "sub_frame", "csp_report", "object", "other", "ping"] |
|||
}; |
|||
|
|||
chrome.webRequest.onHeadersReceived.addListener(details => { |
|||
const nuke = ['https://arch.b4k.co/', 'https://kohlchan.net/']; |
|||
if (nuke.some(u => details.url.startsWith(u)) && details.type == "main_frame") { |
|||
const e = details.responseHeaders.findIndex(e => e.name.toLowerCase() == "content-security-policy"); |
|||
if (e >= 0) |
|||
details.responseHeaders[e].value = ""; |
|||
return { |
|||
responseHeaders: [ |
|||
...details.responseHeaders, |
|||
{ name: 'access-control-allow-origin', value: '*' } |
|||
] |
|||
}; |
|||
} |
|||
}, filts, ['blocking', 'responseHeaders']); |
@ -0,0 +1,35 @@ |
|||
|
|||
const pc = postCommon; |
|||
const pcasf = pc.addSelectedFile.bind(pc); |
|||
let prevFile; |
|||
pc.addSelectedFile = (f, unk) => { |
|||
pcasf(f, unk); |
|||
// will only embed in the first file
|
|||
const refresh = () => { |
|||
const currentFile = pc.selectedFiles[0]; |
|||
if (prevFile != currentFile) { |
|||
prevFile = currentFile; |
|||
document.dispatchEvent(new CustomEvent("PEEFile", { detail: prevFile })); |
|||
} |
|||
}; |
|||
refresh(); |
|||
const rb = pc.selectedDiv.lastChild?.getElementsByClassName("removeButton")[0]; |
|||
if (rb) |
|||
rb.addEventListener("click", refresh); |
|||
}; |
|||
|
|||
document.addEventListener("QRSetFile", (e) => { |
|||
if (pc.selectedFiles.length > 0) |
|||
pc.selectedFiles[0] = e.detail.file; |
|||
}); |
|||
|
|||
const taup = thread.addUnreadPost.bind(thread); |
|||
thread.addUnreadPost = (e) => { |
|||
taup(e); |
|||
|
|||
document.dispatchEvent(new CustomEvent("ThreadUpdate", { |
|||
detail: { |
|||
newPosts: ['b.' + e.postId] |
|||
} |
|||
})); |
|||
} |
@ -1,6 +1,4 @@ |
|||
<!DOCTYPE html> |
|||
<body> |
|||
<script src="./polyfill.min.js"></script> |
|||
<script src="./browser-polyfill.min.js"></script> |
|||
<script src="./dist/background.js"></script> |
|||
</body> |
|||
|
@ -1 +1 @@ |
|||
{"addons":{"{34ac4994-07f2-44d2-8599-682516a6c6a6}":{"updates":[{"version":"0.325","update_link":"https://git.coom.tech/fuckjannies/lolipiss/raw/branch/%E4%B8%AD%E5%87%BA%E3%81%97/pngextraembedder-0.325.xpi"}]}}} |
|||
{"addons":{"{34ac4994-07f2-44d2-8599-682516a6c6a6}":{"updates":[{"version":"0.328","update_link":"https://git.coom.tech/fuckjannies/lolipiss/raw/branch/%E4%B8%AD%E5%87%BA%E3%81%97/pngextraembedder-0.328.xpi"}]}}} |
Loading…
Reference in new issue