Junction icon indicating copy to clipboard operation
Junction copied to clipboard

Provide a way for apps to specify which URIs they can open

Open lunaneff opened this issue 2 years ago • 6 comments

It would be cool if apps could specify which URIs they can open. Maybe something like this in the .desktop file:

[Desktop Entry]
...
X-Junction-UriPrefixes=https://example.com;http://example.com;https://example.org/withPath

lunaneff avatar Feb 19 '22 10:02 lunaneff

Yes but it should be submitted for review as a freedesktop standard.

I don't have time to work on this ATM but I'm happy to build the implementation in Junction if anyone is willing to put work into a specification that https://www.freedesktop.org can get behind.

For inspiration

  • https://developer.android.com/training/app-links#web-links
  • https://developer.apple.com/library/archive/documentation/General/Conceptual/AppSearch/UniversalLinks.html
  • https://docs.microsoft.com/en-us/windows/uwp/launch-resume/web-to-app-linking

sonnyp avatar Feb 19 '22 11:02 sonnyp

Desktop Interfaces should probably be used for such feature.

There is an example for Terminal Intent https://gitlab.freedesktop.org/xdg/xdg-specs/-/merge_requests/46

sonnyp avatar Feb 19 '22 11:02 sonnyp

Incorporating Fincky like functionality in Junction could be quite an effort, but it lays out a well thought out and implemented design.

Coming from the Mac, I adore the way https://github.com/johnste/finicky#example-configuration solves this problem with a Javascript configuration file that can specify RegExp patterns on URIs and more. However, the best of both worlds is when Finicky becomes the default web browser or handler of HTTP MIME types and then it evaluates how to handle the URI. For no Finicky matches, it passes control to it's default browser, which could be a browser picker like Junction. So, the pattern of invocation of HTTP MIME type would need to change to Fincky or it's equivalent first, and it would need to be configured to pick Junction.

Could there be a manner to shell out to a command which could do URI filtering/rewriting and exit with a matching browser handler identified or error on no-match which would allow the current Junction experience? There's a little bit of an chicken and egg problem here based on MIME type defaults.

mlavi avatar Sep 11 '22 03:09 mlavi

@mlavi this is out of scope for this issue which is about apps, not users.

Please file a separate issue. I made something similar but closed it due to lack of interest, perhaps an issue would give the idea more visibility https://github.com/sonnyp/Junction/pull/16

sonnyp avatar Sep 11 '22 07:09 sonnyp

I think there is simpler way to accomplish this by introducing config where urls are matched against desktop entry name. I guess it's fitting to have config in json, so I'll try to have a look

andrhua avatar Aug 03 '23 14:08 andrhua

https://gitlab.freedesktop.org/xdg/shared-mime-info/-/issues/199

sonnyp avatar Sep 08 '23 16:09 sonnyp