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

How does it work? #118

Open
d1y opened this issue Jun 25, 2020 · 2 comments
Open

How does it work? #118

d1y opened this issue Jun 25, 2020 · 2 comments

Comments

@d1y
Copy link

d1y commented Jun 25, 2020

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)?

@xvrh
Copy link
Owner

xvrh commented Jun 26, 2020

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.

@d1y
Copy link
Author

d1y commented Jun 26, 2020

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?

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

2 participants