I am trying to collect the encounter id from a Puppeteer script that opens a browser. I run these scripts in AWS synthetic canaries. It does not run, the error reads:
sessionStorage is not defined Stack
This is the code I use
let data = sessionStorage.getItem('aw-encounter-id');
The browser (Puppeteer) needs to support sessionStorage. This article may help:
According to that, it might work if you initialize passing a data dir:
puppeteer.launch({userDataDir: '/tmp/myChromeSession'});