Cannot access localStorage. Access is denied for this document.
See original GitHub issueSteps to reproduce
Tell us about your environment:
- Puppeteer version: ^0.13.0
- Platform / OS version: Windows 10
What steps will reproduce the problem?
Please include code that reproduces the issue.
await(page.evaluate(() => { localStorage.clear(); debug('localstorage cleared'); }));
What is the expected result? Localstorage should be cleared.
What happens instead? exception::Error: Evaluation failed: DOMException: Failed to read the ‘localStorage’ property from ‘Window’: Access is denied for this document.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:5
- Comments:15 (6 by maintainers)
Top Results From Across the Web
Failed to read the 'localStorage' property from 'Window'
Uncaught SecurityError: Failed to read the 'localStorage' property from 'Window': Access is denied for this document. ... This exception is thrown when the...
Read more >Iframe in Chrome error: Failed to read 'localStorage' from ...
Uncaught SecurityError: Failed to read the 'localStorage' property from 'Window': Access is denied for this document.
Read more >Failed to read the 'localStorage' property from 'Window'
Failed to read the 'localStorage' property from 'Window': Access is denied for this document. I have implemented Chat in my Web site using ......
Read more >Reading from own LocalStorage is denied within an iframe
Uncaught DOMException: Failed to read the 'localStorage' property from 'Window': Access is denied for this document. The code to read the data from ......
Read more >Things not available when someone blocks all cookies
Uncaught DOMException: Failed to read the 'localStorage' property from 'Window': Access is denied for this document.
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
Hi @ebidel it seems to work:) like this
Does
evaluateOnNewDocument
work for this use case? The code you pass it will get injected into the page before other scripts run.https://pptr.dev/#?product=Puppeteer&version=v1.8.0&show=api-pageevaluateonnewdocumentpagefunction-args