puppeteer/utils/browser
2018-10-04 14:23:03 -07:00
..
README.md docs(bundling): add docs about bundling for web (#3348) 2018-10-04 14:23:03 -07:00
test.js chore(testserver): prepare test server (#3294) 2018-09-24 12:46:39 -07:00
WebSocket.js chore: make sure Puppeteer bundling works (#3239) 2018-09-13 20:08:51 +01:00

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.