Rocket.Chat.Electron
Rocket.Chat.Electron copied to clipboard
New option for open link with browser
Hello,
following a remark from my wife, would it be possible to add a function to configure the browser to use to open the links?
In his company, IE11 is defined as the default browser (under win7) and can not be modified.
Thanks.
I would like to see this feature for Linux clients as well.
i have default Chrome, but opened by Firefox. would like this feature too.
This would be a great feature, and it seems to already exist in the iOS client https://github.com/RocketChat/Rocket.Chat.iOS/issues/208
On linux, RocketChat rightfully defers to xdg for the browser. To see the current value run,
xdg-settings get default-web-browser
and to set your default browser run,
# for firefox...
xdg-settings set default-web-browser firefox.desktop
# for chrome...
xdg-settings set default-web-browser google-chrome.desktop
See /usr/share/applications
for other browsers.
Actually on Linux, I already have it set to chromium-browser:
$ xdg-settings get default-web-browser
chromium-browser.desktop
But it opens firefox.
I think its related to snapd or there is some bug inside it, it worked fine with the .deb rocketchat
Update: My solution was to remove firefox from the system and then chromium worked as expected, rocketchat-desktop started using chromium. I do not have time to investigate further.
1. quit rocketchat
2. sudo apt remove firefox
3. sudo systemctl restart snapd
4. start rocketchat
Actually I did some more research and the issue is not related to rocketchat but to snapd, xdg-open in snap is replaced with:
#!/bin/sh
exec snapctl user-open "$@"
if len(os.Args) == 3 && os.Args[1] == "user-open" {
if err := xdgopenproxy.Run(os.Args[2]); err != nil {
fmt.Fprintf(os.Stderr, "user-open error: %v\n", err)
os.Exit(1)
}
os.Exit(0)
}
..............
func Run(urlOrFile string) error {
bus, err := dbus.SessionBus()
if err != nil {
return err
}
defer bus.Close()
launcher := bus.Object("io.snapcraft.Launcher", "/io/snapcraft/Launcher")
return launch(launcher, urlOrFile)
}
............
func openUrl(launcher dbus.BusObject, url string) error {
return launcher.Call("io.snapcraft.Launcher.OpenURL", 0, url).Err
}
[D-BUS Service]
Name=io.snapcraft.Launcher
Exec=@bindir@/snap userd
AssumedAppArmorLabel=unconfined
For Linux
xdg-settings set …
wasn't enough for me.
Be sure that result of xdg-settings get default-web-browser
is also set to almost all "web" values in ~/.config/mimeapps.list
Example with qutebrowser
:
xdg-settings get default-web-browser
org.qutebrowser.qutebrowser.desktop
grep qutebrowser ~/.config/mimeapps.list
[Default Applications]
x-scheme-handler/http=org.qutebrowser.qutebrowser.desktop
x-scheme-handler/https=org.qutebrowser.qutebrowser.desktop
x-scheme-handler/ftp=org.qutebrowser.qutebrowser.desktop
x-scheme-handler/chrome=org.qutebrowser.qutebrowser.desktop
text/html=org.qutebrowser.qutebrowser.desktop
application/x-extension-htm=org.qutebrowser.qutebrowser.desktop
application/x-extension-html=org.qutebrowser.qutebrowser.desktop
application/x-extension-shtml=org.qutebrowser.qutebrowser.desktop
application/xhtml+xml=org.qutebrowser.qutebrowser.desktop
x-scheme-handler/about=org.qutebrowser.qutebrowser.desktop
x-scheme-handler/unknown=org.qutebrowser.qutebrowser.desktop
I also have the gnome-www-browser and x-www-browser alternatives set to qutebrowser
's path :
sudo update-alternatives --config gnome-www-browser
There are 3 choices for the alternative gnome-www-browser (providing /usr/bin/gnome-www-browser).
Selection Path Priority Status
------------------------------------------------------------
* 0 /usr/bin/qutebrowser 200 auto mode
1 /usr/bin/chromium 40 manual mode
2 /usr/bin/firefox-esr 70 manual mode
3 /usr/bin/qutebrowser 200 manual mode
sudo update-alternatives --config x-www-browser
There are 3 choices for the alternative x-www-browser (providing /usr/bin/x-www-browser).
Selection Path Priority Status
------------------------------------------------------------
* 0 /usr/bin/qutebrowser 200 auto mode
1 /usr/bin/chromium 40 manual mode
2 /usr/bin/firefox-esr 70 manual mode
3 /usr/bin/qutebrowser 200 manual mode