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

[FEATURE REQUEST] Playwright Support with timesnap-core #57

Open
tungs opened this issue Apr 24, 2021 · 1 comment
Open

[FEATURE REQUEST] Playwright Support with timesnap-core #57

tungs opened this issue Apr 24, 2021 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@tungs
Copy link
Owner

tungs commented Apr 24, 2021

Playwright is a Puppeteer alternative that offers out-of-the-box support for additional browsers, including Firefox and WebKit. The API is similar with Puppeteer's, though there are some differences that make it not completely interchangeable (in particular, Playwright's page.addInitScript, instead of page.evaluateOnNewDocument). It would be nice to add support for Playwright, so it could be used with timesnap/timesnap-core.

Is your feature request related to a problem? Please describe.
No

Describe the solution you'd like
It would be nice to make timesnap (and therefore timesnap-core) compatible with Playwright by checking for alternative playwright API calls and and using those if available.

Describe alternatives you've considered
An alternative could be to use timeweb and Playwright, though that might replicate some of the work in timesnap and timecut.

@tungs tungs added the enhancement New feature or request label Apr 24, 2021
@tungs tungs self-assigned this Apr 24, 2021
@tungs
Copy link
Owner Author

tungs commented Aug 14, 2021

In implementing this now, there are some differences in the functions used by timesnap:

  • page.evaluateOnNewDocument becomes page.addInitScript
  • page.viewport becomes page.viewportSize
  • page.setViewport becomes page.setViewportSize, and does not support deviceScaleFactor
  • page.evaluate can take at most two arguments, the first being the function to evaluate, the second is the argument to pass to that function. Playwright does not support passing multiple arguments to the passed function. Instead, it recommends combining multiple ones into a single object.
  • page.goto(url, { waitUntil: 'networkidle0' }) does not seem to wait for the page to finish all network connections

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

No branches or pull requests

1 participant