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

feat: add support for Chromium on all platforms #535

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

cristianoventura
Copy link
Collaborator

Description

This PR extends the Linux PR #513 and makes Chromium the second default browser for all platforms.

How to Test

  • Install Chromium
  • Change the order of browser detection in browser.ts to make sure Chromium is detected
  • On Windows, Chromium needs to be available in the system's $PATH for it to be detected. Once it's added, restart your terminal and relaunch the application npm start

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):

Related PR(s)/Issue(s)

Resolves #533

@cristianoventura cristianoventura self-assigned this Mar 7, 2025
@cristianoventura cristianoventura marked this pull request as ready for review March 7, 2025 22:57
@cristianoventura cristianoventura requested a review from a team as a code owner March 7, 2025 22:57
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.

I installed Chromium with homebrew and got this error:
image

image

I can't launch the app either, so it's not a studio problem, but I believe we should handle it gracefully
image

Copy link
Collaborator Author

@cristianoventura cristianoventura left a comment

Choose a reason for hiding this comment

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

I installed Chromium with homebrew and got this error: image

@going-confetti I've made some changes in the browser process to catch the exception and used a listener to show a toast in the frontend. I'll pick up #525 next so we can make the settings dialog more accessible.

image

Comment on lines +99 to +104
const browserProc = launch({
executablePath: path,
args: args,
onExit: sendBrowserClosedEvent,
})
browserProc.nodeProcess.on('error', sendBrowserLaunchFailedEvent)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

launch uses spawn under the hood, which handles errors asynchronously, so try/catch doesn't work here and we need to listen on error instead.

going-confetti
going-confetti previously approved these changes Mar 11, 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!

e-fisher
e-fisher previously approved these changes Mar 19, 2025
Copy link
Collaborator

@e-fisher e-fisher left a comment

Choose a reason for hiding this comment

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

Tested with chromium on Windows - had to specify browser executable manually, but otherwise worked as expected 👌

@Llandy3d
Copy link
Member

Tested with chromium on Windows - had to specify browser executable manually, but otherwise worked as expected 👌

Would be interesting to understand why it fails since we are trying to autodetect it there as well 🤔

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.

Add support for Chromium
4 participants