evOo-local/apps/desktop/src/window-open.ts
cynarAI 6c7eed7580 Initial clean evOo-local from f00577b
Fresh history cut from cynarAI/evoo antigravity-handoff/project-timeline
(Voice First + project timeline). Brand docs/titles as evOo; keep @rakazo/*
packages as tech debt. Excludes node_modules, caches, secrets, voice blobs.
2026-09-20 17:15:16 +02:00

24 lines
570 B
TypeScript

const OAUTH_POPUP_NAMES = new Set([
"rakazo-app-connect",
"rakazo-mcp-oauth",
"rakazo-model-oauth",
"rakazo-plugin-connect",
]);
export function shouldOpenInAppPopup(
appOrigin: string | null,
childUrl: string,
frameName: string,
) {
let target: URL;
try {
target = new URL(childUrl);
} catch {
return false;
}
const isHttp = target.protocol === "http:" || target.protocol === "https:";
if (appOrigin !== null && target.origin === appOrigin) return isHttp;
return target.protocol === "https:" && OAUTH_POPUP_NAMES.has(frameName);
}