puppeteer/utils/browser/README.md
2018-10-04 14:23:03 -07:00

783 B

Bundling For Web Browsers

To bundle Puppeteer using Browserify:

  1. Clone Puppeteer repository: git clone https://github.com/GoogleChrome/puppeteer && cd puppeteer
  2. Run npm run bundle

This will create ./utils/browser/puppeteer-web.js file that contains Puppeteer bundle.

You can use it later on in your web page to drive another browser instance through its WS Endpoint:

<script src='./puppeteer-web.js'></script>
<script>
  const puppeteer = require('puppeteer');
  const browser = await puppeteer.connect({
    browserWSEndpoint: '<another-browser-ws-endpont>'
  });
  // ... drive automation ...
</script>

See our puppeteer-web tests for details.