![]() import = require('electron')ĬontextBridge. Install npm i types/puppeteer-core Weekly Downloads 587,375 Version 7.0.4 License MIT Unpacked Size 1. There are lots of workarounds, but most recently there is a puppeteer-in-electron package which allows you to run puppeteer within electron app using the electron.įirst, install the dependencies, npm install puppeteer-in-electron puppeteer-core electron Make sure you get the correct version puppeteer or puppeteer-core for the version of Chrome that is running in Electron!.Make sure the puppeteer is connected before the app is initiated.Path to a Chromium executable to run instead of bundled Chromium. npm i puppeteer-core or 'yarn add puppeteer-core' puppeteer-core is intended to be a lightweight version of Puppeteer for launching an existing browser installation or for connecting to a remote one. // Whether to run Chromium in headless mode. However you need to make sure of two points, Since version 1.7.0 we publish the puppeteer-core package, a version of Puppeteer that doesn't download any browser by default. ![]() ![]() ![]() Specially electron doesn't have all of the chrome.* API which is needed for chromium browser to work properly, many flags still doesn't have proper replacements such as the headless flag.īelow you will see two ways to do it. They have tons of differences in the API. You cannot use electron executable with Puppeteer directly without some workarounds and flag changes. ![]()
0 Comments
Leave a Reply. |