Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: It's not possible to select browser executable on macOS #576

Merged
merged 3 commits into from
Mar 19, 2025

Conversation

cristianoventura
Copy link
Collaborator

Description

This PR resolves an issue that prevents selecting the correct executable browser path on macOS from the settings page.

How to Test

  • open Settings > Recorder
  • select a custom browser path
  • notice that the correct executable path was populated

Checklist

  • I have performed a self-review of my code.
  • I have added tests for my changes.
  • I have run linter locally (npm run lint) and all checks pass.
  • I have run tests locally (npm test) and all tests pass.
  • I have commented on my code, particularly in hard-to-understand areas.

Screenshots (if appropriate):

Screen.Recording.2025-03-18.at.4.14.56.PM.mov

Related PR(s)/Issue(s)

Resolves #562 #501

@cristianoventura cristianoventura self-assigned this Mar 18, 2025
@cristianoventura cristianoventura requested a review from a team as a code owner March 18, 2025 20:24
Comment on lines +86 to +89
<Callout.Text>
The selected executable doesn&apos;t appear to be compatible.
Please select the correct executable for Chrome or Chromium.
</Callout.Text>
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This message does not really detect that the selected browser is correct. In practice you could rename the Firefox executable to Chrome and it would bypass it, but it handles the most common scenarios and warns the user about incompatibilities.

Comment on lines +144 to +148
const executableName = getExecutableNameFromPlist(plistPath)
if (executableName) {
return path.join(filePath, 'Contents', 'MacOS', executableName)
}
return filePath
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we read the executable name from Info.plist, if available.

Comment on lines +9 to +10
if (typeof plistData.CFBundleExecutable === 'string') {
return plistData.CFBundleExecutable
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CFBundleExecutable is the default location for the executable name

'chromium.exe',
'/chrome',
'/chromium',
]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably include chromium derived browsers, for example Edge 🤔
I wonder if there's a better way to detect a working browser, maybe like doing a test run in the background and checking that a request is actually recorded, might be too laborious thou 😄

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably include chromium derived browsers, for example Edge 🤔

I wouldn't do it at this stage. If the user wants to try another Chromium-based browser, they should do it at their own risk.
As far as I understand, we don't prevent the user from selecting a different browser, so they can still try to use other browsers.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The message is discouraging thou, so maybe we can iterate on it in the future when we confirm also other chromium based browsers so that we can add them to the list 🤔
After all we are officially supporting only Chrome at this time

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We haven't really tested in other Chrome-based browsers and potential ramifications they introduce so I'd say it's safer to just go with Chrome and Chromium for now.


<Callout.Text>
The selected executable doesn&apos;t appear to be compatible.
Please select the correct executable for Chrome or Chromium.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hint only mentions Google Chrome. If we release this without the Chromium PR, it might be confusing

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can make that change in the Chromium support PR once we fully validated it's working for all plaforms #535

going-confetti
going-confetti previously approved these changes Mar 19, 2025
Copy link
Collaborator

@going-confetti going-confetti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@cristianoventura cristianoventura merged commit 6f17b97 into main Mar 19, 2025
3 checks passed
@cristianoventura cristianoventura deleted the fix/select-chrome-executable-macos branch March 19, 2025 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

It's not possible to select browser executable on macOS
3 participants