Open URL in user browser

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By brunosxs
:warning: Old Version Published before Godot 3 was released.

Hello friends, silly question, but really useful.
I am creating a plugin and wanted to make a link to the online documentations.
The solutions I came up with were:

  • Make a call to a browser with the OS.execute() and pass the url as an argument… not really modular as I’d need to know the path to the browser on non-linux machines.

  • Create an url with bbcode [url={url}]{text}[/url] as I did, but when clicked on a PC with ubuntu, it simply doesn’t open the page.

What am I doing wrong and what would you recommend?

:bust_in_silhouette: Reply From: Akien

I think that what you want is OS.shell_open(String uri) (see OS classref).

The ONLY option I didn’t look because it had no info about it on the help haha.
“URI” wasn’t strange to me, but I simply overlooked.
Thanks a bunch.

brunosxs | 2016-06-28 13:54