feat(capture): add minimal browser extension
This commit is contained in:
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user