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

What is the correct way to open URLs from application? #519

Closed
BryanQuigley opened this issue Jul 31, 2020 · 10 comments
Closed

What is the correct way to open URLs from application? #519

BryanQuigley opened this issue Jul 31, 2020 · 10 comments
Labels

Comments

@BryanQuigley
Copy link

Trying to figure out the correct way to make a link work (started with flathub/de.uni_heidelberg.zah.GaiaSky#1 links don't work - app I am working on).

Decided to see what other apps do and found
flathub/gedit. Help -> About > gedit.org | opens that webpage as a text file in gedit itself.
flathub/Rhythmbox Help-> About -> Rhythmbox website works as expected.
flathub/LibreOffice links open in external browser correctly
flathub/Steam - links open in external browser correctly

@TingPing
Copy link
Member

So the application looks like its written in Java which makes it annoying and I'm not familiar with it. The simple solution is for it to execute xdg-open https://example.org and it will just work inside of Flatpak.

@TingPing TingPing changed the title Links not working to open in browser What is the correct way to open URLs from application? Jul 31, 2020
@felipeborges
Copy link
Contributor

clicking on gedit.org opens the website in a browser here too, as expected.

@BryanQuigley
Copy link
Author

I've helped find another case where GaiaSky doesn't have working links.

@felipeborges can we compare setups? It's possible that I have something wrong on my system.
Ubuntu 20.10 dev
org.gnome.gedit 3.36.2 stable flathub system
ostree 2020.5-1
xdg-desktop-portal 1.6.0-1
flatpak 1.8.1-2

xdg-open http://www.gedit.org does do the right thing.

@felipeborges
Copy link
Contributor

Gotcha, I was running an older version of gedit. This seems like a regression.

@BryanQuigley
Copy link
Author

@hadess
Copy link
Contributor

hadess commented Sep 22, 2020

Is this really using gnome_url_show() from the 2.x era libgnome? That's been deprecated for the best part of 10 years.

@hadess
Copy link
Contributor

hadess commented Sep 22, 2020

I don't know what Java should be using, but I'm pretty certain that gnome_url_show() didn't know anything about x-scheme-handler

@TingPing
Copy link
Member

Java should probably be using g_app_info_launch_default_for_uri_async().

@nbenitez
Copy link

Java should probably be using g_app_info_launch_default_for_uri_async().

A more short term solution would be to patch our flathub openjdk extension to use that api or to just launch a xdg-open command. I proposed that on the following issue:
flathub/org.freedesktop.Sdk.Extension.openjdk11#15

@GeorgesStavracas
Copy link
Member

Given the proposals above, and the investigation that was done, I'm considering this out of scope for XDG desktop portal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Triaged
Development

No branches or pull requests

6 participants