

How to Convert HTML into PDF with Node.js and Puppeteer.

Here are some Puppeteer tutorials which run Puppeteer with the default Chromium browser: If you have an existing project which uses the default Chromium to run Puppeteer, you can change it to run with Firefox without creating a new project. Using Firefox with an Existing Puppeteer Project You can see that a Firefox Nightly window is launched and the URL in the code is visited. Creating a New Node.js ProjectĬreate a new puppeteer-firefox folder and go to the directory. The most recent version of Firefox Nightly will be downloaded automatically when you install the Puppeteer package via npm. To run Puppeteer with Firefox, you will need to have these installed:įor reference, these are the versions used in this tutorial:Īlthough we will be running Puppeteer with Firefox, you don’t need to install Firefox manually.

Besides that, Puppeteer can also be used for other things like generating screenshots and PDFs of pages, crawling web pages, automating form submission, etc. It is commonly used by developers to automate the browser to run website tests. Puppeteer can do most things we do manually on the browser. It is an ongoing collaboration between Puppeteer and Mozilla to support cross-browser testing coverage for developers. It is developed to provide a high-level API to control Chrome or Chromium over Chrome DevTools Protocol.Īlthough Puppeteer is developed to run on Chrome, Puppeteer supports Firefox from Puppeteer v2.1.0 onwards. Puppeteer is a Node library that is open source and maintained by Google. You can use automation tool like Puppeteer to carry out automated testing on these browsers. Although all browser vendors follow the Web Standards, each browser renders the code differently. When developing an application, it is important to perform cross browser testing to make sure that the application runs as intended on different browsers like Google Chrome, Firefox, Safari, etc.
