You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
web: PDF preview blocked by CSP (missing frame-src/object-src) #52591
Start the web UI (opencode serve / background service, e.g. http://127.0.0.1:4096).
Open a PDF via file preview (attachment / file viewer preview mode).
Observe the preview iframe.
Expected Behavior
PDF renders inside the preview iframe.
Actual Behavior
Iframe shows:
This content is blocked. Contact the site owner to fix the issue.
Additional Context
Not X-Frame-Options — GET / returns no X-Frame-Options header. It returns this Content-Security-Policy (same on /_assets/*):
There is no frame-src / child-src / object-src / worker-src, so a blob:/data: PDF URL in an iframe falls back to default-src 'self' and is blocked. Chrome's PDF viewer then shows the generic "content is blocked" message.
Likely fix: add e.g. frame-src 'self' blob: data:; object-src 'self' blob: data:; worker-src 'self' blob: to the web-UI CSP.
Activity
github-actions commentedon Oct 1, 2026
This issue might be a duplicate of an existing issue. Please check:
frame-src, blockingblob:iframes with the “This content is blocked” message.