puppeteer-extra-plugin-interceptor
A puppeteer-extra plugin that simplifies request interception and response modification.
Status : Experimental
The underlying APIs in the Chrome Devtools Protocol are all labeled "Experimental" so this plugin should be considered experimental as well.
Who is this for
- Developers troubleshooting in production
- QA Engineers
- Reverse Engineers
- Penetration Testers
Documentation
Please see puppeteer-interceptor. This is just a wrapper to use with puppeteer-extra's plugin system.
Installation
$ npm install puppeteer-extra-plugin-interceptor
Usage
const puppeteer = ;const interceptor patterns = ; puppeteer; { const browser = await puppeteer; const page = await browser; page; }
Example
This example uses Prettier to automatically intercept and prettify all JavaScript.
const puppeteer = ;const interceptor patterns = ; puppeteer; const prettier = ; { responsebody = prettier; return response;} { const browser = await puppeteer; const page = await browser; page; // intercept URLs in new tabs browser; }