element-hq / element-desktop

A glossy Matrix collaboration client for desktop.
https://element.io
Apache License 2.0
1.09k stars 243 forks source link

element-desktop ignores gnome preferred application settings for http/https/html #1636

Open strufepub opened 2 months ago

strufepub commented 2 months ago

Steps to reproduce

Reproduce: Open element-desktop Click on a link See the wrong browser being opened

Outcome

My gnome settings for my preferred browser are set to firefox (update-alternatives x-www-browser and gnome-www-browser). All apps use firefox to open web pages when I click on links.

Element version: 1.11.64 Crypto version: Rust SDK 0.7.0 (61b175b), Vodozemac 0.5.1 insists to open links in another browser, which is installed on the system as well.

Uninstalling of the browser and element-desktop has not changed anything

Operating system

Description: Ubuntu Noble Numbat (development branch) Release: 24.04

Application version

Element version: 1.11.64 Crypto version: Rust SDK 0.7.0 (61b175b), Vodozemac 0.5.1

How did you install the app?

$ apt-cache policy element-desktop element-desktop: Installed: 1.11.64 Candidate: 1.11.64 Version table: *** 1.11.64 500 500 https://packages.element.io/debian default/main amd64 Packages 100 /var/lib/dpkg/status

Homeserver

I do not know, university server at KIT

Will you send logs?

Yes

t3chguy commented 2 months ago

Element Desktop doesn't handle this, its down to Electron which I believe delegates to xdg-open.

strufepub commented 2 months ago

xdg-open correctly opens in firefox. I'm not sure how to test Electron

strufepub commented 2 months ago

As an update: I've installed yet another browser (for some external testing purposes), and Element now chooses the last installed browser to open http/https. xdg-open is still not affected, so it's an Element issue, I fear..

t3chguy commented 2 months ago

so it's an Element issue, I fear..

Electron* given we rely on https://www.electronjs.org/docs/latest/api/shell#shellopenexternalurl-options doing the right thing - https://github.com/element-hq/element-desktop/blob/develop/src/webcontents-handler.ts#L56