puppeteer: [problem] Mac OS Firewall popup on every launch of puppeteer
With every launch on mac os, it causes mac os to ask the following question
“Do you want to the application Chromium.app to accept incoming network connections?”
Steps to reproduce
- Puppeteer version: 1.18.1
- Platform / OS version: Mac OS Sierra 10.12.4
- Node.js version:v11.2.0
What steps will reproduce the problem?
const browser = await puppeteer.launch({ headless: false })
and visit any url...
What is the expected result?
Chromium window appear with the site content
What happens instead?
Chromium window appear with the site content And the Mac OS alert pop ups asking “Do you want to the application Chromium.app to accept incoming network connections?”
No matter what you do with the Mac OS Firewall setting it keeps asking it again and again and again.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 75
- Comments: 26 (2 by maintainers)
This is what I used. It’ll prompt you for your password. Then the next time Chromium with a head opens up youll get the prompt one last time and youre good to go from then on. Enjoy!
Go to system preferences then create a self signed certificate (keychen app, “trousseaux d’acces” in french). Tell a name “MyCertificateName”, self signed root and code signing certificate type. Tell system that you trust it.
Open a command and write "codesign -s MyCertificateName -f ./tothepath/yourapp.app --deep
Your app is now self signed and trusted for all the system, you should not be notified anymore (it worked for me)
For me after creating the certificate, it was under “login” keychain so I had to drag and drop it to “System”, then run the command above again.
As chromium revision in puppeteer is updated frequently I put
--deep
flag at the beginning ofcodesign
command. So, after puppeteer update re-sign is very simple:My solution, based off @jesperronn
Add the following alias to your
bash_profile
ofzsh_profile
or whatever.Then run
fix-chromium-permissions-locally
in each project folder you need it. Also might be required each timenode_modules
is updated/reinstalled 👍i made something a bit more generic, as every puppeteer version generate a different mac-xxxxx path thanks for @Madvinking
Works like a charm! Great fix!
Let me update the tutorial, ok?
App to run on Mac is:
Keychain Access.app
Finish the process
Select first tab: All things and search for Pupeteer
Copy the certificate
Select System > My certificates
Paste copied certificate Pupeteer
Remove certificate from the previous place (was in Logging > My certificates).
Find your chromium app path.
Enter the signing command (my path):
I ended up adding a bash alias based on your suggestions:
Here’s another option?
Assumes you’re not using whatever features the “DialMediaRouteProvider” provides
This is still an issue I have experienced it. This process needs to be documented somewhere. The steps to fix this issue should not be in a github issue.
Thanks,
sudo codesign -s Puppeteer -f ./node_modules/puppeteer/.local-chromium/mac-674921/chrome-mac/Chromium.app --deep
worked. Note thatsudo
is needed but it doesn’t complain if it’s missing.Thanks! That popup was getting me crazy!
Can a signed Chromium be bundled in?