Skip to content

macOS: Auto detection of executable path when CHROME_PATH has pointed .app folder #460

@yhatt

Description

@yhatt

For setting custom Chrome path, CHROME_PATH environment value requires the path for an executable binary.

In macOS, a common mistake is setting the path for the app /Applications/Google Chrome.app. xxx.app is actually a special directory, not an executable file. A user should set /Applications/Google Chrome.app/Contents/MacOS/Google Chrome instead.

Having said that, the detail of .app is hidden to OS users unless an explicit action. It's natural to think users that setting /Applications/Google Chrome.app is working well.

So it's helpful to provide auto-detection of executable path for macOS when filled all following conditions:

  • os.platform() is 'darwin'.
  • CHROME_PATH env has been set a string that has an ending .app + optional trailing slash.
  • (await fsPromise.stat(env.CHROME_PATH)).isDirectory() is true.

For example, /foo/bar/ABCDEF.app will resolve as /foo/bar/ABCDEF.app/Contents/MacOS/ABCDEF.

We may have to check ./Contents/Info.plist to detect whether CFBundlePackageType is AAPL for more strict detection.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions