feat(capture): add minimal browser extension

This commit is contained in:
cesnimda
2026-08-31 22:16:16 +02:00
parent b7029faaec
commit caf486dceb
5 changed files with 95 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
export const JOBBJAKT_CAPTURE_ORIGIN = "https://jobs.cesnimda.uk";
export function buildCaptureUrl(pageUrl, origin = JOBBJAKT_CAPTURE_ORIGIN) {
let source;
try {
source = new URL(pageUrl);
} catch {
return null;
}
if (source.protocol !== "http:" && source.protocol !== "https:") return null;
const capture = new URL("/", origin);
capture.searchParams.set("add", source.href);
return capture.href;
}