Bug 464236 - Add default handler for well-known protocol handlers
Summary: Add default handler for well-known protocol handlers
Status: REPORTED
Alias: None
Product: frameworks-kio
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Arch Linux Linux
: NOR wishlist
Target Milestone: ---
Assignee: KIO Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-01-13 13:20 UTC by Soni L.
Modified: 2023-01-17 19:51 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Soni L. 2023-01-13 13:20:58 UTC
Hello!

Could you add support for Well-Known Protocol Handlers, as in https://github.com/fedi-to/fedi-to.github.io/blob/main/protocol-handler.md , to KTraderClient? xdg-open uses KTraderClient to resolve certain x-scheme-handler/ "MIME types", including x-scheme-handler/web+[...], so this would make it the appropriate place to add support for these.

Thanks!
Comment 1 Nicolas Fella 2023-01-13 14:23:29 UTC
What would be the expected result of running "ktraderclient5 --mimetype x-scheme-handler/web+example"?
Comment 2 Soni L. 2023-01-13 14:54:35 UTC
By default, it should produce a DesktopEntryPath for an app (something along the lines of "Default Web Protocol Handler") which parses the URL and sends it to the default https handler, as per the spec. (Well, for "--servicetype Application", at least)

Obviously another app may choose to override it if desired. For example an app dedicated to web+example would probably want priority over the fallback handler.
Comment 3 Nicolas Fella 2023-01-13 15:58:30 UTC
> as per the spec

Which specification?

What should happen when I do e.g. "xdg-open web+kde:dolphin", assuming there is no explicit app registered for "web+kde"? What would be passed to the scheme handler for https?
Comment 4 Soni L. 2023-01-13 16:40:42 UTC
this spec, from the issue description https://github.com/fedi-to/fedi-to.github.io/blob/main/protocol-handler.md

it only applies to URLs with an authority tho, so something like "web+kde:dolphin" wouldn't work. (also, web+* schemes can be registered by arbitrary websites, so "web+kde:" isn't a particularly good scheme to have. mixing OS tasks with website tasks is a bad idea. "kde:" is fine tho.)
Comment 5 Nicolas Fella 2023-01-13 17:50:02 UTC
So suppose I do "xdg-open web+example://example.org" then the handler would turn that into "https://example.org/.well-known/protocol-handler?target=web%2Bexample%3A%2F%2Fexample.org" and open that in the browser?
Comment 6 Soni L. 2023-01-13 18:32:33 UTC
Yeah.