Skip to content

Instantly share code, notes, and snippets.

Created November 11, 2019 22:16
Show Gist options
  • Save StoneCypher/15c53aa753ffe2fe8fdc3d7f9ffed0b7 to your computer and use it in GitHub Desktop.
Save StoneCypher/15c53aa753ffe2fe8fdc3d7f9ffed0b7 to your computer and use it in GitHub Desktop.

How to fix that Puppeteer popup

... what puppeteer popup?

Or, "Do you want to the application to accept incoming network connections?"

This popup can be very annoying when running your testset headed. None of the relevant memes are work appropriate.

Okay so how do I fix it

The underlying problem is not actually puppeteer, exactly. It's that npm doesn't have the authority to sign mac apps, so when it installs and builds chrome, it's an untrusted app, and the firewall will warn you every time it tries, thinking it's some 1337 r00t haxore kit.

In order to fix it, what you need to do is tell the operating system that the app is explicitly trusted. There are two steps to that, one one-time, and one (unfortunately) every time you reinstall

That's great, I'll just script it and

Giving trust to a script to manage the keychain is an exceptionally poor idea. Don't do it.

Just get the step from this gist manually. How often do you update puppeteer?

Fine, what do I do by hand

The one-time part is to create a self-signed certificate by which you can manually anoint an app.

The every-time part is using it to anoint that install of puppeteer.

  1. One time, create the certificate
    1. Using spotlight search, open Keychain Access
    2. Under the menu Keychain Access,
      1. go to the sub-menu Certificate Assistant, then
      2. hit Create a self-signed certificate
      3. Give it an obvious name. I use Puppeteer signing certificate
      4. Identity type should be self-signed root
      5. Let the rest of the defaults go
  2. Each install, apply it to Chromium
    1. Under our stack, it's in node_modules/puppeteer/.local-chromium/mac-(some number)/chrome-mac/
      1. That number varies per build, but it's usually the only one, so tab complete it
    2. The correct form of the command is this, with the number fixed :
      1. sudo codesign -s Puppeteer -f ./node_modules/puppeteer/.local-chromium/mac-674921/chrome-mac/ --deep
        • got stuck in an apparently infinite series of requests for my password :/

After that, you should no longer receive the popups.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment