puppeteer-dart icon indicating copy to clipboard operation
puppeteer-dart copied to clipboard

How does it work?

Open d1y opened this issue 4 years ago • 2 comments

I haven't read the source code, but I guess whether there is a nodejs binary file, which is called by exec?

I actually want to ask if I use this plugin, how big will it be after being packaged into an apk (how big will this plugin occupy)?

d1y avatar Jun 25 '20 18:06 d1y

This library is a complete re-write of the puppeteer API (which is developed in NodeJS), it doesn't use at all nodejs.

This library works like this:

  • Download the compiled chromium binaries (if needed)
  • Start the chromium process with some specifics flags to enable "automation mode"
  • Open a websocket connection to the chromium devtools to send json commands
  • Expose a high-level API to perform classical browser automation tasks (navigate, click button, capture network etc...).

Note that starting a chromium process is not supported on platform like Android and iOS (you can't launch arbitrary process with custom flags as per OS restriction). If you want to use this library on mobile, you will have to launch the chromium process on a server.

xvrh avatar Jun 26 '20 07:06 xvrh

I think I get it. I need to run the library on ios and andriod to implement web crawlers. Could you tell me how big it is after packaging?

d1y avatar Jun 26 '20 16:06 d1y