[Feature] API for changing localStorage
See original GitHub issueI’m trying to get the localStorage
of an app via:
const storage = await context.storageState();
and it outputs: { cookies: [], origins: [] }
and then I try:
const localStorage = await page.evaluate(() =>
JSON.stringify(window.localStorage)
);
console.log(localStorage);
and I get: page.evaluate: Evaluation failed: DOMException: Failed to read the 'localStorage' property from 'Window': Access is denied for this document.
I know this page has localStorage
because In between tests, I can see the localStorage
in the Application tab.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:24
- Comments:28 (6 by maintainers)
Top Results From Across the Web
Using the Web Storage API - MDN Web Docs
The Web Storage API provides mechanisms by which browsers can securely store key/value pairs.
Read more >JavaScript LocalStorage: a Complete Guide
The complete guide on LocalStorage, it's API, a code walkthrough, and various trade-offs and limitations compared to other storage options.
Read more >localStorage in JavaScript: A complete guide - LogRocket Blog
The Web Storage API consists of two mechanisms: sessionStorage and localStorage . Both sessionStorage and localStorage maintain a separate ...
Read more >Listen for changes with localStorage on the same window
setItem; localStorage. ... createEvent now is part of an old, deprecated API. ... addEventListener('storage', function(e) { document.
Read more >LocalStorage, sessionStorage - The Modern JavaScript Tutorial
The localStorage is shared between all windows with the same origin, so if we set the data in one window, the change becomes...
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 Free
Top 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
for someone
@dcerniglia Look into
page.addInitScript()
: