#2051 Opening Uri by its scheme handler

endragor Fri 9 Nov 2012

Is there a way to open an uri by system registered scheme handler using built-in API? It is platform-dependent and therefore I'd like to see a solution in the language API (like open or process method in sys::Uri class).

  • On Windows it's done by launching "rundll32 url.dll,FileProtocolHandler <uri>".
  • On MacOS: "open <uri>".
  • On Linux it seems to depend on distribution.

brian Sat 10 Nov 2012

Might want to see this section: http://fantom.org/doc/docLang/Naming.html#resolving

I don't think we currently have a sys::File representation of http though. But we do have solid unification of File for both local files and zip entries.

endragor Sun 11 Nov 2012

What I mean is not resolving Uris into Fantom objects but passing them to OS for it to handle them.

For example, I might want my application to open http Uri in default browser.

Steam registers for handling "steam://" Uris and to run a steam game you should open "steam://rungameid/[game_id]" uri.

And there are other similar cases.

brian Mon 12 Nov 2012

No nothing like that except sys::Process. Although if there is a Java API for it, be happy to add it.

ivan Tue 13 Nov 2012

In SWT there's org.eclipse.swt.program::Program#launch and it is already included into Fantom distribution

brian Tue 13 Nov 2012

Promoted to ticket #2051 and assigned to brian

Okay, we can at least add something like that into FWT then. I will look (or if someone wants to send me a patch even better!). I'm thinking just a static method on Desktop

brian Mon 20 May 2013

Ticket resolved in 1.0.65

Added fwt::Desktop.launchProgram(Uri)

Login or Signup to reply.