@b4n commented on this pull request.


>       {
-               gchar *new_cmd = dialogs_show_input(_("Select Browser"), 
GTK_WINDOW(main_widgets.window),
-                       _("Failed to spawn the configured browser command. "
-                         "Please correct it or enter another one."),
+               /* Uses the user's default browser akin to xdg-open (in flatpak 
through a portal) */
+               if (EMPTY(tool_prefs.browser_cmd))
+               {
+                       if 
(gtk_show_uri_on_window(GTK_WINDOW(main_widgets.window), uri, GDK_CURRENT_TIME, 
NULL))

Just be aware of one thing: `gtk_show_uri*()` will happily open a *lot* more 
URIs than what the web browser might support.  It basically can open *any* URI, 
be it `http:`, `mailto:` or `my-custom-scheme:`.  It's nice and all, but some 
suggest that it should be handled with care not to open random programs using 
random schemes.

Admittedly, there's two things going for us here:
* we're not a chat app or such, we don't present mangled untrusted URIs
* all internal URIs are safe and likely (?) to open in the browser (`https:`, 
`file:` -- need to check that last one though)

But we cannot know what plugins might do.

Though we should check how are `file:` URIs handled. We use that in help, and 
when using the builtin build exec command.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/3178#pullrequestreview-1304215240
You are receiving this because you are subscribed to this thread.

Message ID: <geany/geany/pull/3178/review/[email protected]>

Reply via email to