page-request-emitter
TypeScript icon, indicating that this package has built-in type declarations

2.4.0 • Public • Published

About

It hooks requests from a puppeteer page and emits as Observable.

Usage

You can see the complete example at test/index.spec.ts.

const browser = puppeteer.launch();
const html = `
<script>
fetch("http://domain.com", "A").then(()=>{
    fetch("http://not-domain.com", "B")
}).then(()=>{
    fetch("http://domain.com", "C")
})
</script>`
streamPageEvents(browser, "http://domain.com", html, async (page:puppeteer.Browser, req:puppeteer.Request) => req.postData()).subscribe({
    next: console.log
})

// output
// A
// C

Readme

Keywords

none

Package Sidebar

Install

npm i page-request-emitter

Weekly Downloads

3

Version

2.4.0

License

MIT

Unpacked Size

11.6 kB

Total Files

12

Last publish

Collaborators

  • ingun37