Repository navigation
Restore theme storage and feed access in previews - #55
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c68f872364
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
|
@codex review |
|
Codex Review: Didn't find any major issues. Another round soon, please! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Problem
Preview documents run in an opaque origin (
sandbox allow-scripts, noallow-same-origin). Theme scripts that readlocalStorage,sessionStorage, ordocument.cookieduring startup throwSecurityError, which aborts theme hydration(for example Astro islands in Ethereal) and breaks display settings, language
switching, and search widgets. Theme widgets that fetch
/rss.xmlalso fail becausethe preview
connect-srcallows only public APIs and the CORS filter covers onlytheme and plugin assets.
Change
Console page/revision preview routes and the sandboxed child used by token previews.
Storage-compatiblelocalStorage/sessionStorage(including property access,length,key, and enumeration) and a per-document cookie jar. It does not exposereal site storage or cookies.
allow-same-origin, so preview scripts still cannotreach site storage, cookies, or the Console parent.
/rss.xml,/feed.xml,/sitemap.xml, and/feed/in the previewconnect-srcand in the CORS filter so theme feed widgets work.sources, and CORS coverage.
Validation
bash gradlew test -x processUiResourcespasses.sandbox="allow-scripts"and a real
Content-Security-Policy: sandbox allow-scriptsresponse:localStoragereads/writes,Object.keys,length, anddocument.cookiework.Limitations
and the administrator's real site preferences are not exposed to preview scripts.
script-free visual editing canvas.