feat(userscript): GM_xmlhttpRequest transport, GM storage, metadata banner and build
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
17ecebc4a4
commit
162ab4afb0
5 files changed
+195
No files matched your search
@@ -0,0 +1,21 @@
|
||||
/** Tampermonkey/Violentmonkey metadata. @connect lists every host GM_xmlhttpRequest may reach. */
|
||||
export function userscriptBanner(version: string, serverUrl?: string): string {
|
||||
const connects = ["api.mangabaka.org", "webtoons.com", "pstatic.net", "web.archive.org", "catbox.moe"];
|
||||
if (serverUrl) connects.push(new URL(serverUrl).hostname);
|
||||
const lines = [
|
||||
"// ==UserScript==",
|
||||
"// @name MangaBaka Seeder",
|
||||
"// @namespace https://gitea.lucaswinther.info/lucasw89/mangabaka-seeder",
|
||||
`// @version ${version}`,
|
||||
"// @description Find every WEBTOON cover of a series and turn them into a MangaBaka cover edit request",
|
||||
"// @match https://mangabaka.org/*",
|
||||
"// @grant GM_xmlhttpRequest",
|
||||
"// @grant GM_getValue",
|
||||
"// @grant GM_setValue",
|
||||
"// @grant GM_deleteValue",
|
||||
...connects.map((host) => `// @connect ${host}`),
|
||||
"// @run-at document-idle",
|
||||
"// ==/UserScript==",
|
||||
];
|
||||
return `${lines.join("\n")}\n\n`;
|
||||
}
|
||||
Reference in new issue
Block a user