storageState
be injected into crawler's page before the page is created? Basically, how to reproduce this but using storageState
from the session instead:prePageCreateHooks: [ async (pageId, browserController, pageOptions) => { const storageState = await KeyValueStore.getValue('storageState'); if (pageOptions && storageState) pageOptions.storageState = storageState; }, ],
storageState
from a session and don't know how to do that in a crawler... Ideally, I need access to browserPool
s context before it is created and before it calls newPage
but haven't found a way. I want to pass options
to the call to newPage
which is the only way to inject the storageState
in PW.finalPageOptions
works only with useIncognitoPages: truebrowserPool
unless in incognito mode. Not sure why, looks like a bug to me... the code there is quite messy. I think there should be a way to intercept the browserPool
calls to newContext()
and inject the options before it's created but didn't find any.