sonnyp / Junction

Application/browser chooser
https://flathub.org/apps/re.sonny.Junction
GNU General Public License v3.0
457 stars 29 forks source link

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

Open lunaneff opened 2 years ago

lunaneff commented 2 years ago

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
sonnyp commented 2 years ago

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

sonnyp commented 2 years ago

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

mlavi commented 1 year ago

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.

sonnyp commented 1 year ago

@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

andrhua commented 11 months ago

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

sonnyp commented 10 months ago

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