{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/vscode/issues/52246","repository_url":"https://api.github.com/repos/Microsoft/vscode","labels_url":"https://api.github.com/repos/Microsoft/vscode/issues/52246/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/vscode/issues/52246/comments","events_url":"https://api.github.com/repos/Microsoft/vscode/issues/52246/events","html_url":"https://github.com/Microsoft/vscode/issues/52246","id":333485573,"node_id":"MDU6SXNzdWUzMzM0ODU1NzM=","number":52246,"title":"Option to enable localStorage in WebView panels","user":{"login":"jdgarcia","id":899916,"node_id":"MDQ6VXNlcjg5OTkxNg==","avatar_url":"https://avatars1.githubusercontent.com/u/899916?v=4","gravatar_id":"","url":"https://api.github.com/users/jdgarcia","html_url":"https://github.com/jdgarcia","followers_url":"https://api.github.com/users/jdgarcia/followers","following_url":"https://api.github.com/users/jdgarcia/following{/other_user}","gists_url":"https://api.github.com/users/jdgarcia/gists{/gist_id}","starred_url":"https://api.github.com/users/jdgarcia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdgarcia/subscriptions","organizations_url":"https://api.github.com/users/jdgarcia/orgs","repos_url":"https://api.github.com/users/jdgarcia/repos","events_url":"https://api.github.com/users/jdgarcia/events{/privacy}","received_events_url":"https://api.github.com/users/jdgarcia/received_events","type":"User","site_admin":false},"labels":[{"id":752866026,"node_id":"MDU6TGFiZWw3NTI4NjYwMjY=","url":"https://api.github.com/repos/Microsoft/vscode/labels/*out-of-scope","name":"*out-of-scope","color":"E2A1C2","default":false},{"id":272689392,"node_id":"MDU6TGFiZWwyNzI2ODkzOTI=","url":"https://api.github.com/repos/Microsoft/vscode/labels/feature-request","name":"feature-request","color":"dcdcdc","default":false},{"id":403154666,"node_id":"MDU6TGFiZWw0MDMxNTQ2NjY=","url":"https://api.github.com/repos/Microsoft/vscode/labels/webview","name":"webview","color":"c5def5","default":false}],"state":"open","locked":false,"assignee":{"login":"mjbvz","id":12821956,"node_id":"MDQ6VXNlcjEyODIxOTU2","avatar_url":"https://avatars2.githubusercontent.com/u/12821956?v=4","gravatar_id":"","url":"https://api.github.com/users/mjbvz","html_url":"https://github.com/mjbvz","followers_url":"https://api.github.com/users/mjbvz/followers","following_url":"https://api.github.com/users/mjbvz/following{/other_user}","gists_url":"https://api.github.com/users/mjbvz/gists{/gist_id}","starred_url":"https://api.github.com/users/mjbvz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mjbvz/subscriptions","organizations_url":"https://api.github.com/users/mjbvz/orgs","repos_url":"https://api.github.com/users/mjbvz/repos","events_url":"https://api.github.com/users/mjbvz/events{/privacy}","received_events_url":"https://api.github.com/users/mjbvz/received_events","type":"User","site_admin":false},"assignees":[{"login":"mjbvz","id":12821956,"node_id":"MDQ6VXNlcjEyODIxOTU2","avatar_url":"https://avatars2.githubusercontent.com/u/12821956?v=4","gravatar_id":"","url":"https://api.github.com/users/mjbvz","html_url":"https://github.com/mjbvz","followers_url":"https://api.github.com/users/mjbvz/followers","following_url":"https://api.github.com/users/mjbvz/following{/other_user}","gists_url":"https://api.github.com/users/mjbvz/gists{/gist_id}","starred_url":"https://api.github.com/users/mjbvz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mjbvz/subscriptions","organizations_url":"https://api.github.com/users/mjbvz/orgs","repos_url":"https://api.github.com/users/mjbvz/repos","events_url":"https://api.github.com/users/mjbvz/events{/privacy}","received_events_url":"https://api.github.com/users/mjbvz/received_events","type":"User","site_admin":false}],"milestone":null,"comments":9,"created_at":"2018-06-19T01:10:07Z","updated_at":"2018-08-24T15:18:36Z","closed_at":null,"author_association":"NONE","body":"I am currently using the `vscode.previewHtml` command to display a web app in VS Code (via iframe) which uses `localStorage` to store persisting state, and I am currently trying to convert it to use the new Webview API, in order to take advantage of the new `retainContextWhenHidden` option. I noticed however that while accessing `localStorage` works fine when using `vscode.previewHtml`, it is disabled in panels that use the Webview API.\r\n\r\nI saw that a persistence API is currently being worked on (https://github.com/Microsoft/vscode/issues/49022), but in order to even use that, I would have to wrap all my `localStorage` gets/sets in async functions that check to see if `localStorage` is accessible, and if it isn't, use message passing between the iframe and the webview in order to use `getState`/`setState` inside the webview.\r\n\r\nThat would be doable but it's definitely not ideal.\r\n\r\n[This comment](https://github.com/Microsoft/vscode/issues/48464#issuecomment-384105131) seems to imply that it is disabled intentionally but is something that can potentially be enabled.\r\n"},"comment":{"url":"https://api.github.com/repos/Microsoft/vscode/issues/comments/415791462","html_url":"https://github.com/Microsoft/vscode/issues/52246#issuecomment-415791462","issue_url":"https://api.github.com/repos/Microsoft/vscode/issues/52246","id":415791462,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNTc5MTQ2Mg==","user":{"login":"vscodebot[bot]","id":28792856,"node_id":"MDM6Qm90Mjg3OTI4NTY=","avatar_url":"https://avatars2.githubusercontent.com/in/2406?v=4","gravatar_id":"","url":"https://api.github.com/users/vscodebot%5Bbot%5D","html_url":"https://github.com/apps/vscodebot","followers_url":"https://api.github.com/users/vscodebot%5Bbot%5D/followers","following_url":"https://api.github.com/users/vscodebot%5Bbot%5D/following{/other_user}","gists_url":"https://api.github.com/users/vscodebot%5Bbot%5D/gists{/gist_id}","starred_url":"https://api.github.com/users/vscodebot%5Bbot%5D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vscodebot%5Bbot%5D/subscriptions","organizations_url":"https://api.github.com/users/vscodebot%5Bbot%5D/orgs","repos_url":"https://api.github.com/users/vscodebot%5Bbot%5D/repos","events_url":"https://api.github.com/users/vscodebot%5Bbot%5D/events{/privacy}","received_events_url":"https://api.github.com/users/vscodebot%5Bbot%5D/received_events","type":"Bot","site_admin":false},"created_at":"2018-08-24T15:18:36Z","updated_at":"2018-08-24T15:18:36Z","author_association":"NONE","body":"This issue is being closed to keep the number of issues in our inbox on a manageable level, we are closing issues that are not going to be addressed in the foreseeable future: We look at the number of votes the issue has received and the number of duplicate issues filed. If you disagree and feel that this issue is crucial: We are happy to listen and to reconsider.\n\nIf you wonder what we are up to, please see our [roadmap](https://aka.ms/vscoderoadmap) and [issue reporting](https://aka.ms/vscodeissuereporting) guidelines.\n\nThanks for your understanding and happy coding!"}}
{"actor":{"display_login":"vscodebot"}}