I have this script to modify localStorage of my browser instance (assuming all definitions are correct). it returns this Error. I have a feeling that this is because Playwright is launching a browser in incognito mode. Is there a way for me to launch browser in normal mode?
Script:
const rdlocalStorage = fs.readFileSync('localstorage.json','utf8');
const deserializedStorage = JSON.parse(rdlocalStorage);
console.log (deserializedStorage);
await page.evaluate((deserializedStorage)=>{
for (const key in deserializedStorage){
localStorage.setItem(key,deserializedStorage[key]);
}
}, deserializedStorage);
Error Message enter image description here