511dcf9d32
Add `browser.isConnected()` to the public api to be able to tell when the browser is connected fixes https://github.com/smooth-code/jest-puppeteer/pull/237#issuecomment-490260041 |
||
---|---|---|
.. | ||
.ci | ||
examples | ||
lib | ||
misc | ||
.cirrus.yml | ||
.gitignore | ||
.npmignore | ||
DeviceDescriptors.js | ||
Errors.js | ||
index.js | ||
install.js | ||
LICENSE | ||
package.json | ||
README.md | ||
tsconfig.json |
Puppeteer for Firefox
Use Puppeteer's API with Firefox
BEWARE: This project is experimental. 🐊 live here. Is Puppeteer-Firefox Ready?
Getting Started
Installation
To use Puppeteer with Firefox in your project, run:
npm i puppeteer-firefox
# or "yarn add puppeteer-firefox"
Note: When you install puppeteer-firefox, it downloads a custom-built Firefox (Firefox/63.0.4) that is guaranteed to work with the API.
Usage
Example - navigating to https://example.com and saving a screenshot as example.png:
Save file as example.js
const pptrFirefox = require('puppeteer-firefox');
(async () => {
const browser = await pptrFirefox.launch();
const page = await browser.newPage();
await page.goto('https://example.com');
await page.screenshot({path: 'example.png'});
await browser.close();
})();
Execute script on the command line
node example.js
API Status
Current tip-of-tree status of Puppeteer-Firefox is availabe at isPuppeteerFirefoxReady?
Credits
Special thanks to Amine Bouhlali who volunteered the puppeteer-firefox
NPM package.