-
-
Notifications
You must be signed in to change notification settings - Fork 744
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
[WIP] feat: Rewrite to automation-extra, Support both Playwright and Puppeteer #303
Conversation
Wow! That's huge PR @berstend, thanks for playwright support! |
I'm waiting for this PR as mom waits for her son from the army!!! |
Haha 😄 Unfortunately progress abruptly stopped due to an injury but I'm getting back to it now. :) |
Hi! i can see that the docs were updated to include |
@opahopa you need to install Docs have only been updated for the |
Thank you so much, this is amazing work! Are there any plans for porting stealth over to Playwright in the near future? |
@berstend Excellent job on porting this to Playwright. I'm running into an issue when using the recaptcha plugin if you use all the browsers { chromium, firefox, webkit } = require('playwright-extra') it fails to find the executable for any of the browsers. |
@wesley-campbell-q2 did you install |
@j3lev I ran npm install playwright playwright-extra @extra/recaptcha. |
@wesley-campbell-q2 Playwright just released 1.9 today and might not work properly with this port yet, try |
@j3lev Based off what I'm seeing you need to install as npm i playwright@1.8 playwright-extra@next but that still fails me |
same issue -- it looks like its downloading some versions of the browsers, axing them, and then downloading new ones. |
Everyone willing to test the new versions:
That means:
TL;DR (😢):
|
I started work on |
How will playwright updates work? I'm assuming every release will be tied to a specific playwright version? |
The same as with the existing Regarding If someone found a way to hook into the underlying CDP communication (the existing page session, not a new one) in playwright let me know :-) |
Has the API changed for the humanize plugin? It does not appear to work and the syntax "firefox.use" throws a type error when using playwright. Maybe I am just oblivious but any pointers would be much appreciated. |
Are you following the instructions mentioned here? The readme's in the If you or someone else have issues: Please mention how you installed packages (the exact command line) edit, after a discussion with the user on discord it turned out npm was the issue here - I made a more prominent note in the info post to use yarn for the temporary |
I created a canonical issue with condensed info on how to install the new |
I locked this PR so subscribers only get pinged when there's official "updates" of sorts. :-) For feedback and bug reports on the new automation-extra branch please use this ticket: #454 If you're interested in chatting about this type of stuff make sure to join our friendly community over on discord. We're really close to finalizing the new code and the release should happen soon. |
- I was overcomplicating it. - Now I am getting the frame, then from within the frame, access the text - TODO: Log in in the new window now!
I'm closing this PR/rewrite for now, it's a good reference for future additions though. |
Update: Beta versions are available for testing now
Gist
automation-extra
package, which is the underlying shared foundation for bothplaywright-extra
and the newpuppeteer-extra
packageautomation-extra-plugin
(cleaner API, adds Playwright events, better type safety)Motivation for adding playwright support: puppeteer/puppeteer#3667
Status
automation-extra
- Finished: We have plugin support for both Playwright & Puppeteerplaywright-extra
- Finished: It's just a small entry point toautomation-extra
to make things more clear & type safeautomation-extra-plugin
- Finished for now:I want to add shims to make plugins supporting both pptr & playwright less verbose (e.g. pptr haspage.evaluateOnNewDocument
, playwright hascontext.addInitScript
)I haven't switchedpuppeteer-extra
over to use the newautomation-extra
code base yet, but specific tests againststealth
,adblocker
,recaptcha
are all green 🚀Next steps
I realized pretty late in the process of adding Playwright support that I need to make the code backwards compatible with existing plugins, so new
automation-extra-plugin
based plugins work with bothplaywright-extra
andpuppeteer-extra
(the latter still supportingpuppeteer-extra-plugin
's). 😅Replacepuppeteer-extra
with a small package using the new code inautomation-extra
Make sure all tests in the whole monorepo are green after thatPort the first plugin over to support both Playwright & PuppeteerAdd/update/improve/fix documentation where neededOnce that's done we should be able to push/publish this stuff without breaking anything. Afterwards I'll start porting other existing plugins to support both Playwright and Puppeteer (their APIs differ, so existing puppeteer plugins need to be modified to support both - this PR is about the underlying plugin framework itself).
In the process of porting the plugins I will extend
automation-extra-plugin
wherever it makes sense (add new unified events (e.g.addScript
) or add some sort of shim).Known issues
I removed that crusty "data from plugins" stuff, so this breaks e.g. thepuppeteer-extra-plugin-user-data-dir
plugin (I'll come up with a cleaner replacement API).launchPersistentContext()
is not yet augmented with plugin functionality