Skip to content

Commit

Permalink
Fix sessionStorage-related crash when running in sandboxed iframe (py…
Browse files Browse the repository at this point in the history
…odide#5186)

Fixes this problem when Pyodide is running within a sandboxed iframe:

Uncaught SecurityError: Failed to read the 'sessionStorage' property from
'Window': The document is sandboxed and lacks the 'allow-same-origin' flag.
  • Loading branch information
josephrocca authored Nov 11, 2024
1 parent ea444c1 commit b098934
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions docs/project/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ myst:
- {{ Fix }} JSPI support now works with support for new JSPI and no WebAssembly type reflection.
{pr}`5129`

- {{ Fix }} Fix sessionStorage-related crash when running in sandboxed iframe.
{pr}`5186`

### Packages

- Upgraded `crc32c` to 2.7.1 {pr}`5169`
Expand Down
2 changes: 1 addition & 1 deletion src/js/environments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const IN_BROWSER_MAIN_THREAD =
typeof window === "object" &&
typeof document === "object" &&
typeof document.createElement === "function" &&
typeof sessionStorage === "object" &&
"sessionStorage" in window &&
typeof importScripts !== "function";

/** @private */
Expand Down

0 comments on commit b098934

Please sign in to comment.