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

[Question] How to start webkit with persistent context? #5642

Closed
downstream84 opened this issue Feb 27, 2021 · 2 comments
Closed

[Question] How to start webkit with persistent context? #5642

downstream84 opened this issue Feb 27, 2021 · 2 comments

Comments

@downstream84
Copy link

downstream84 commented Feb 27, 2021

I want to start webkit as I can do with chromium or firefox using PersistentContext, so that I can read data from a forum which I browse and use the saved session.

In chromium I do

options['executablePath'] = '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome';
var browser = await playwright.chromium.launchPersistentContext(data_directory['chrome'], options);

How can I do the same for Safari (WebKit)?

@pavelfeldman
Copy link
Member

Setting up a context using persistent session and then reusing it isn't a recommended way of handling logged-in tests, etc. The recommended way is described here and here. The idea is that you use CLI to set up your context, then you persist the state into the file and re-create as many ephemeral contexts that use this initial data as you'd like. It works with all the browsers. Please tell us if that was what you were looking for.

@yury-s
Copy link
Member

yury-s commented Mar 10, 2021

Closing per the response above.

@yury-s yury-s closed this as completed Mar 10, 2021
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

No branches or pull requests

3 participants