Skip to content

Latest commit

 

History

History
36 lines (26 loc) · 1.25 KB

readme.md

File metadata and controls

36 lines (26 loc) · 1.25 KB

puppeteer-web bundle created using browserify

Why?

  • The bundlers fails to bundle puppeteer, and downloading puppeteer repo just to build puppeteer-web version seems like a hassle for quick development.
  • Puppeteer team removed puppeteer-web from their repo in this PR
  • The previous puppeteer could be found here on this commit, but it's a pain to build that as well.
  • Lots of questions in stackoverflow like this shows the demand of such library.

Usage

yarn add puppeteer-web
import puppeteer from 'puppeteer-web';

async function run(){

  const browser = await puppeteer.connect({
    browserWSEndpoint: `ws://0.0.0.0:8080`, // <-- connect to a server running somewhere
    ignoreHTTPSErrors: true
  });

  const pagesCount = (await browser.pages()).length;
  const browserWSEndpoint = await browser.wsEndpoint();
  console.log({ browserWSEndpoint, pagesCount });

}

Roadmap

  • Auto build new minorversion on new puppeteer-core release
  • Update document about pitfall
  • Add server and client example along with a explanation post