Allow app/twiddle to access localStorage
See original GitHub issueI was trying to make a repro repo for the ember-localstorage-adapter using ember-twiddle, but it seems that the app is “sandboxed” or otherwise disallowed from accessing localStorage
. I assume this is related to some kind of security concern. Is there a way to work around it? (e.g. set a flag in the config or something?)
https://ember-twiddle.com/d526982f42a741ee1379bbb76c2548c1?openFiles=routes.application.js%2C
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Window.localStorage - Web APIs | MDN
The localStorage read-only property of the window interface allows you to access a Storage object for the Document's origin; the stored data ...
Read more >Using localStorage with React Hooks - LogRocket Blog
In this guide, we cover how to use localStorage to persist a user's form input in the browser storage using React Hooks. We'll...
Read more >localStorage - use getItem/setItem functions or access object ...
One uses encapsulation (getter/setter) to better protect the data and for simple usage. You're supposed to use this style (for security). The other...
Read more >LocalStorage, sessionStorage - The Modern JavaScript Tutorial
Web storage objects localStorage and sessionStorage allow to save ... In that case getItem/setItem work fine, while object-like access fails ...
Read more >How to Use localStorage with React Hooks to Set and Get Items
localStorage is a web storage object that allows JavaScript sites and apps to keep key-value pairs in a web browser with no expiration...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Give codesandbox a try for this scenario.
As long as I had to click an “OK, hack me” button first (or alternatively if it would only allow it for my own twiddles) then I would be OK with that. Ideally, there’d be a way to grant permissions in a more granular way than all or nothing. e.g.
allow-storage-access-by-user-activation
(see sandbox section of https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe)