Skip to content

Templates page shows no templates when localStorage is blocked #36

Open

Description

@blixvip

public/index.html runs one big inline script. At line 1827 it calls localStorage.getItem(PROVIDER_KEY) at the top level, with no try/catch. When the browser blocks storage (some privacy settings, embedded contexts, certain private modes), that call throws a SecurityError and the rest of the script never runs.

Reproduce: run npm run dev. In Chrome, block site data for 127.0.0.1 (Settings > Privacy > Site data), then open /index.html. No template cards render, and the status stays at "Checking bridge". With storage allowed, 23 cards render.

The same unguarded calls appear at index.html:1830 (provider change handler) and index.html:2047 (api()), and in public/create.html:367 and :399.

Fix direction: add small readStore(key) / writeStore(key, value) helpers that wrap the calls in try/catch. site-shell.js:28-29 already does this. Use them at each of the lines above. Lines 1364 and 1418 are already guarded.

Done when /index.html and /create.html load fully with site data blocked: cards render and the bridge status updates. Nothing changes with storage allowed.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions