Skip to content

Instantly share code, notes, and snippets.

@sriramrudraraju
Last active December 13, 2019 18:58
Show Gist options
  • Save sriramrudraraju/57016b8ececcda542b1ff3bd19800996 to your computer and use it in GitHub Desktop.
Save sriramrudraraju/57016b8ececcda542b1ff3bd19800996 to your computer and use it in GitHub Desktop.

Local Storage using Puppeteer

 // store in localstorage the token
await page.evaluateOnNewDocument (
  token => {
    localStorage.clear();
    localStorage.setItem('token', token);
  }, 'eyJh...9_8cw');
// open the url
await page.goto('http://localhost:3000/Admin', { waitUntil: 'load' });

github issue

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