Skip to content

Fall back to in-memory settings when localStorage is blocked - #160

Open
Bortlesboat wants to merge 1 commit into
ekzhang:mainfrom
Bortlesboat:fix-blocked-localstorage
Open

Bortlesboat wants to merge 1 commit into
ekzhang:mainfrom
Bortlesboat:fix-blocked-localstorage

Conversation

@Bortlesboat

Copy link
Copy Markdown

When sshx is embedded in a cross-origin iframe with third-party storage blocked, reading localStorage throws a SecurityError while the app loads and the page stays blank. This uses a plain writable store in that case, so the join screen renders and settings just aren't remembered. I checked it by bundling settings.ts and loading it with a localStorage that throws: it failed before the change and works after. svelte-check is clean.

Fixes #152

Reading localStorage throws a SecurityError in a cross-origin iframe
with third-party storage disabled, which crashed the app on load and
left a blank page. Use a plain writable store in that case so the app
still starts; settings just aren't remembered.

Fixes ekzhang#152
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Blank page when embedded in a cross-origin iframe with third-party storage blocked (unguarded localStorage access)

1 participant