2024-01-29 04:21:19 -08:00
|
|
|
const ORIGIN = readOrigin();
|
|
|
|
const SUPPORT_SECRET = readSupportSecret();
|
2024-01-28 07:00:29 -08:00
|
|
|
|
|
|
|
export function buildImpress2020Url(path) {
|
2024-01-29 04:21:19 -08:00
|
|
|
return new URL(path, ORIGIN).toString();
|
2024-01-28 07:00:29 -08:00
|
|
|
}
|
|
|
|
|
2024-01-29 04:21:19 -08:00
|
|
|
export function getSupportSecret() {
|
|
|
|
return SUPPORT_SECRET;
|
|
|
|
}
|
|
|
|
|
|
|
|
function readOrigin() {
|
2024-01-28 07:00:29 -08:00
|
|
|
const node = document.querySelector("meta[name=impress-2020-origin]");
|
|
|
|
return node?.content || "https://impress-2020.openneo.net"
|
|
|
|
}
|
2024-01-29 04:21:19 -08:00
|
|
|
|
|
|
|
function readSupportSecret() {
|
|
|
|
const node = document.querySelector("meta[name=impress-2020-support-secret]");
|
|
|
|
return node?.content || null;
|
|
|
|
}
|