This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
[Feature Request] Fallback URI to OpenURI #1110
Labels
needs discussion
Needs discussion on how to implement or fix the corresponding task
new api
This requires adding API to an existing portal
portal: openuri
OpenURI portal
A Java application which is hoping to support Flatpak has this code: https://github.com/fedi-to/fedicraft/blob/default/src/main/java/net/fedi_to/fc/os/NonWinMac.java which launches xdg-open if there is a scheme handler available, and launches a fallback URL (helping the user to install whatever is needed, etc) if not.
My first suggestion was to simply remove the check and call xdg-open, expecting an error to be returned in the case there is no handler. However, unlike the unsandboxed xdg-open (which returns 4 in this case), the sandboxed xdg-open wrapper apparently succeeds and returns 0, because the portal (at least here on GNOME) presents a dialog to the user to select or install an app.
Is there some way for the application to distinguish these two cases and guide the user accordingly? Or could we add a fallback URI property to the Open URI method, analagous to https://learn.microsoft.com/en-us/uwp/api/windows.system.launcheroptions.fallbackuri?view=winrt-22621#windows-system-launcheroptions-fallbackuri ?
The text was updated successfully, but these errors were encountered: