Documentation
    Preparing search index...

    Function probeTargetCors

    • Probe a target dev server for opaque-origin CORS support.

      Sends Origin: null explicitly — a browser cannot forge that header, but the Paja server can, which is why the probe runs server-side.

      Parameters

      • targetUrl: string

        Absolute target URL served by the napplet dev server.

      • fetchImpl: PajaTargetCorsFetch = defaultTargetCorsFetch

        Fetch implementation; defaults to the global fetch.

      Returns Promise<PajaTargetCorsDiagnostic>

      Diagnostic describing whether the sandboxed frame can load assets.

      const diagnostic = await probeTargetCors('http://127.0.0.1:5173/');
      if (diagnostic.status === 'blocked') console.warn(diagnostic.hint);