Pending XHR Puppeteer
| Introduction | Installation | Usage | Contribute |
Introduction
Pending XHR Puppeteer is a tool that detect when there is xhr requests not yet finished. You can use it to have a xhr requests count or to wait for all xhr requests to be finished.
Installation
To install with yarn :
yarn add pending-xhr-puppeteer -D
To install with npm :
npm install pending-xhr-puppeteer --save-dev
Usage
wait for all xhr requests to be finished
const puppeteer = ;const PendingXHR = ; const browser = await puppeteer; const page = await browser;const pendingXHR = page;await page;// Here all xhr requests are not finishedawait pendingXHR;// Here all xhr requests are finished
Get the number of pending xhr
const puppeteer = ;const PendingXHR = ; const browser = await puppeteer; const page = await browser;const pendingXHR = page;await page;console;// Display the number of xhr pending
Contribute
git clone https://github.com/jtassin/pending-xhr-puppeteer.gitcd pending-xhr-puppeteeryarnyarn test
Merge requests and issues are welcome.