question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is it possible to run puppeteer on electron window?

See original GitHub issue

In nightmare.js, there is a possibility to take advantage of the electron window. That doesn’t require us to use external chromium nor google chrome executables, because chromium is already bundled into electron.

So, can I take an advantage of that? Been slightly looking through docs and found out that puppeteer always requires to specify the chromium executable path to be used and there seem to be no way to overcome this and work nicely within electron process.

Regards

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:19

github_iconTop GitHub Comments

23reactions
TrevorSundbergcommented, Aug 8, 2019

I wrote a small library to take care of this for my own projects: https://www.npmjs.com/package/puppeteer-in-electron

It uses the above webSocketDebuggerUrl approach. This does work in the latest version of puppeteer and electron. Disclaimer, the whole library needs a lot of testing.

The other thing I spent a long time trying to solve was how to associate an electron BrowserWindow with a puppeteer Page. I ended up writing a routine that injects JavaScript into the BrowserWindow and searches for that specific Page in puppeteer.

I would note that there are a few limitations in puppeteer, for example you cannot intercept requests due to electron not supporting the network service.

13reactions
WilliamChiucommented, Jul 16, 2019

@AnthoniG If you have the time, would you be able to include a code snippet? I am having trouble with this same task right now

Read more comments on GitHub >

github_iconTop Results From Across the Web

puppeteer-in-electron - npm
Run puppeteer within an electron app.. Latest version: 3.0.5, last published: a year ago. Start using puppeteer-in-electron in your project ...
Read more >
Using Node.js, Puppeteer and ElectronJS to Create a Web ...
Puppeteer is a pretty cool Node.js library. Developed by the Google Chrome team, it provides you with the tools to easily control a...
Read more >
Puppeteer-in-electron NPM - npm.io
Introducing puppeteer-in-electron. Use puppeteer to test and control your electron application. npm install puppeteer-in-electron puppeteer-core electron.
Read more >
puppeteer-in-electron - npm Package Health Analysis - Snyk
Is puppeteer-in-electron safe to use? ... The npm package puppeteer-in-electron was scanned for known vulnerabilities and missing license, and no issues were ...
Read more >
Automated Testing | Electron
With WebdriverIO​ · Install the test runner​ · Connect WDIO to your Electron app​ · Run your tests​.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found