You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 11, 2025. It is now read-only.
Is your feature request related to a problem? Please describe.
In order to test Chrome Extensions (and other persistent use cases), it would be nice if chrome can be launched in persistent mode. Explicitly passing a userDataDir to launch results in userDataDir option is not supported in `browserType.launch`. Use `browserType.launchPersistentContext` instead
An alternative would be to create a new option along the lines of persistentDataDir.
This would allow us to setup a custom environment for extensions like so:
classCustomEnvironmentextendsPlaywrightEnvironment{asyncsetup(){awaitsuper.setup()letpopupPageUrlconstbackgroundPage=awaitthis.global.browser.waitForEvent('backgroundpage')// this is only available via chromium.launchPersistentContextconstextensionId=backgroundPage.url().split('/')[2]popupPageUrl=`chrome-extension://${extensionId}/popup.html#`this.global.page.gotoPopup=function(url,options={}){constpaddedUrl=!url.startsWith('/') ? `/${url}` : urlreturnpage.goto(popupPageUrl+paddedUrl,options)}}asyncteardown(){// Your teardownawaitsuper.teardown()}}