puppeteer/experimental/puppeteer-firefox
Sergio M 60249e0bc2 fix: Page.setContent working with unicode strings (#4433)
Fix `page.setContent` with unicode strings that exceeds the range of a 8-bit byte.

This patch implements decoding part of the [MDN's solution #4 for the "unicode problem"](https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding#Solution_4_%E2%80%93_escaping_the_string_before_encoding_it).

Since we rely on node.js buffer to encode into base64, we don't have troubles with base64 encoding, so it is left as-is.

Fixes #4424
2019-05-18 17:15:16 +03:00
..
.ci feat: introduce puppeteer-firefox (#3628) 2018-12-06 11:24:00 -08:00
examples feat: introduce puppeteer-firefox (#3628) 2018-12-06 11:24:00 -08:00
lib fix: Page.setContent working with unicode strings (#4433) 2019-05-18 17:15:16 +03:00
misc feat: support Response.buffer(), Response.json() and Response.text() (#4063) 2019-02-24 19:31:35 -08:00
.cirrus.yml feat: introduce puppeteer-firefox (#3628) 2018-12-06 11:24:00 -08:00
.gitignore feat: introduce puppeteer-firefox (#3628) 2018-12-06 11:24:00 -08:00
.npmignore feat: introduce puppeteer-firefox (#3628) 2018-12-06 11:24:00 -08:00
DeviceDescriptors.js feat(puppeteer): introduce puppeteer.errors and puppeteer.devices (#4312) 2019-04-19 15:33:06 -07:00
Errors.js feat: introduce puppeteer-firefox (#3628) 2018-12-06 11:24:00 -08:00
index.js feat(firefox): introduce async stacks for Puppeteer-Firefox (#3948) 2019-02-07 15:18:43 -08:00
install.js chore(juggler): Roll Firefox to 120450a2 (#3842) 2019-01-25 15:25:54 -05:00
LICENSE feat: introduce puppeteer-firefox (#3628) 2018-12-06 11:24:00 -08:00
package.json feat(firefox): roll Firefox to 765beffc (#4156) 2019-03-11 17:56:16 -07:00
README.md docs(firefox): Adding bug reference & prototype clarification to juggler (#4402) 2019-05-09 16:27:10 -07:00
tsconfig.json feat: introduce puppeteer-firefox (#3628) 2018-12-06 11:24:00 -08:00

Prototype: Puppeteer for Firefox

Use Puppeteer's API with Firefox

⚠️ BEWARE: Experimental. Just for preview. Installation and usage will change.

This project is a feasibility prototype to guide the work of implementing Puppeteer endpoints into Firefox's code base. Mozilla's bug 1545057 tracks the initial milestone, which will be based on a CDP-based remote protocol.

Getting Started

Installation

To try out 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.