Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use opts.userDataDir if launchPersistentContext calls with empty args #884

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Ponchik501
Copy link

I'm trying to use UserPreferencesPlugin, like

chromium.use(
      UserPreferencesPlugin({
        userPrefs: {
          download: {
            prompt_for_download: false,
            open_pdf_in_system_reader: true
          },
          plugins: {
            always_open_pdf_externally: true
          },
        },
      })
    );
chromium.use(StealthPlugin());
context = await chromium.launchPersistentContext("",  opts);

and according logs user-data-dir never been picked up
instead chrome has been running with playwright_chromiumdev_profileXXX temp dir

puppeteer-extra-plugin:user-data-dir Wrote file /var/folders/j8/fb74tww54y337579fd0rgqzr0000gn/T/puppeteer_dev_profile-K5tcyn/Default/Preferences +1ms
  pw:api => browserType.launchPersistentContext started +0ms
  pw:browser <launching> /Applications/Brave Browser.app/Contents/MacOS/Brave Browser --disable-field-trial-config ... --user-data-dir=/var/folders/j8/fb74tww54y337579fd0rgqzr0000gn/T/playwright_chromiumdev_profile-Br6TEW --remote-debugging-pipe about:blank +0ms
  pw:browser <launched> pid=73167 +71ms

after patch applied I'm getting this

puppeteer-extra-plugin:user-data-dir Wrote file /var/folders/j8/fb74tww54y337579fd0rgqzr0000gn/T/puppeteer_dev_profile-5bhXYb/Default/Preferences +1ms
...
  pw:api => browserType.launchPersistentContext started +0ms
  pw:browser <launching> /Applications/Brave Browser.app/Contents/MacOS/Brave Browser --disable-field-trial-config .... --user-data-dir=/var/folders/j8/fb74tww54y337579fd0rgqzr0000gn/T/puppeteer_dev_profile-5bhXYb --remote-debugging-pipe about:blank +0ms

which is right to me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant