Skip to content

Flatpak fix: add browser detection and launch support#1587

Merged
brianmcgillion merged 1 commit intotiiuae:mainfrom
jkuro-tii:flatpak_browser_fix
Dec 11, 2025
Merged

Flatpak fix: add browser detection and launch support#1587
brianmcgillion merged 1 commit intotiiuae:mainfrom
jkuro-tii:flatpak_browser_fix

Conversation

@jkuro-tii
Copy link
Copy Markdown
Contributor

@jkuro-tii jkuro-tii commented Nov 25, 2025

  • Implement browser detection (Flatpak + local)
  • Add clear error pop-up when no browser is installed
  • Support browser selection (Chrome, Chromium, etc.)
  • Fix unclear errors in Flatpak applications like Spotify when opening web pages

Applications now either successfully launch browsers or show helpful error messages instead of failing silently.

Description of Changes

Type of Change

  • New Feature
  • Bug Fix
  • Improvement / Refactor

Related Issues / Tickets

Checklist

  • Clear summary in PR description
  • Detailed and meaningful commit message(s)
  • Commits are logically organized and squashed if appropriate
  • Contribution guidelines followed
  • Ghaf documentation updated with the commit - https://tiiuae.github.io/ghaf/
  • Author has run make-checks and it passes
  • All automatic GitHub Action checks pass - see actions
  • Author has added reviewers and removed PR draft status

Testing Instructions

Applicable Targets

  • Orin AGX aarch64
  • Orin NX aarch64
  • Lenovo X1 x86_64
  • Dell Latitude x86_64
  • System 76 x86_64

Installation Method

  • Requires full re-installation
  • Can be updated with nixos-rebuild ... switch
  • Other:

Test Steps To Verify:

  1. Do a clean install.
  2. Install Spotify via Flatpak and try to log in.
    Expect “Browser error” window.
  3. Install Google Chrome.
  4. Start Spotify and try logging in.
    Chrome should open and login should work.
  5. Remove Chrome.
  6. Start Spotify again.
    “Browser error” should return.
  7. Install Chromium.
  8. Start Spotify and try logging in.
    Chromium should open and login should work.

Copy link
Copy Markdown
Collaborator

@kajusnau kajusnau left a comment

Choose a reason for hiding this comment

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

Some readability/usability comments.
Looks good overall, hopefully testing confirms functionality. Nice work!

@brianmcgillion
Copy link
Copy Markdown
Collaborator

Should we first try an xdg handler to untrusted browser VM. If that fails, then warn to install a flatpak browser?

@jkuro-tii
Copy link
Copy Markdown
Contributor Author

In the case of Spotify, we cannot use a browser from another VM, due to the way its login flow works:
the app opens the login page in a browser, starts a local TCP listener (e.g., port 4123), and waits for the callback.
After authentication, the browser redirects to http://localhost:4123/
to deliver encrypted login data, which makes onboarding a browser from chrome-vm infeasible.

An option is installing a local browser, which would be run in normal way, out of Flakpak environment.

@Bitumiju
Copy link
Copy Markdown

Bitumiju commented Dec 1, 2025

@jkuro-tii
Copy link
Copy Markdown
Contributor Author

Summary of changes:

  • Flatpak browser is started locally if found - the admin-vm is not no longer involved
  • If the browser has not been found - a dialog window (yad) shows the options of exiting, or continuing with the default (chrome-vm) browser

- Implement browser detection (Flatpak + local)
- Add clear error pop-up when no browser is installed
- Support browser selection (Chrome, Chromium, etc.)
- Fix unclear errors in Flatpak applications like Spotify when opening web pages

Applications now either successfully launch browsers or show helpful error messages instead of failing silently.

Signed-off-by: jkuro-tii <jaroslaw.kurowski@tii.ae>
@enesoztrk enesoztrk added the Needs Testing CI Team to pre-verify label Dec 11, 2025
@milva-unikie
Copy link
Copy Markdown

Tested on Darter Pro (new installation)

Instructions said that a rebuild works, but also asked to do a clean installation. I installed a new image to be safe.

All good.

  • Tested Spotify login with Firefox, Chrome and Chromium, works with all
  • If no browser is installed to flatpak-vm
    • The user is asked to install a browser
    • The user can also select to use the chrome-vm browser

Notes

  • Slack login is not working. This can be fixed later, without this PR none of the logins work.

@milva-unikie milva-unikie added Tested on System76 and removed Needs Testing CI Team to pre-verify labels Dec 11, 2025
@brianmcgillion brianmcgillion merged commit eb17dbf into tiiuae:main Dec 11, 2025
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants