Support panel hosts that serve the page from their own scheme

Codex serves panels from codex-sandbox:// pages, where origins are
opaque: the panel recognizes the app's own addresses by scheme and host,
the vessels feed resolves against the document address, and the dev
server answers Codex's sandbox origins with CORS.
This commit is contained in:
Sameh Khamis committed 2026-10-02 15:21:37 -07:00
1 parent 64c1b1951f
commit b11d54d8b8
5 files changed
+16 -10

No files matched your search

+3 -3
View File
@@ -29,9 +29,9 @@ export function createStandaloneLayerSources() {
military: createAdsbLolSource(),
vessels: createAisStreamSource({
apiUrl: import.meta.env?.VITE_AIS_LIVE_API_URL || '/api/ais-live',
// The app's server, also when a panel page loads the app under <base>.
origin: () =>
new URL(globalThis.document?.baseURI ?? 'http://localhost').origin,
// Resolved against the document's address, which a panel host may
// serve from its own scheme.
origin: () => globalThis.document?.baseURI ?? 'http://localhost',
}),
cctv: createCctvSource(),
radio: createRadioSource(),