Skip to content

Embedded web UI CSP blocks the inline theme preload script #21088

@MakingMofongo

Description

@MakingMofongo

Repro

  1. Run opencode web
  2. Open the web UI through a remote/Tailscale URL instead of localhost
  3. Sign in

The page hangs and the browser console shows:

Executing inline script violates the following Content Security Policy directive: "script-src 'self' 'wasm-unsafe-eval'"...

Cause

packages/opencode/src/server/instance.ts already hashes the inline oc-theme-preload-script for proxied HTML, but the embedded UI path still returns the default CSP without that hash.

Expected

Embedded HTML should use the same hashed CSP logic as the proxied HTML path so the inline theme preload script can run.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions