Open henryju opened 1 year ago
Snaps are Ubuntu specific technology so you may have to look into the code yourself to find a fix for it.
I don't think snap is the real problem here. To me, it looks like a problem with the way the default browser command is parsed from the .desktop file.
As you can see, the command in the Exec section starts with env
, so I guess some code somewhere assumes the browser command will be the first "word" of this string.
Maybe somewhere inside g_app_info_get_default_for_type
, but I could not find more.
SWT doesn't parse desktop files but rather relies on gio to do so. It's pretty standalone part of SWT so one should be able to experiment with it fairly easy https://github.com/eclipse-platform/eclipse.platform.swt/blob/master/bundles/org.eclipse.swt/Eclipse%20SWT%20Program/gtk/org/eclipse/swt/program/Program.java#L114
Note that g_app_info_get_default_for_type is not code maintained by SWT but comes from glib/gio and is invoked via JNI https://docs.gtk.org/gio/type_func.AppInfo.get_default_for_type.html . If you think this is the faulty part you should create snippet showing the issue and reporting it glib maintainers.
I am definitely not a C developer, but I did my best: https://gitlab.gnome.org/GNOME/glib/-/issues/2901
Thank you, it looks quite good report to me for Glib devs to act on.
So apparently, GLib developers are considering that SWT should not use g_app_info_get_executable
to run a program. They are about to update the API documentation:
https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3240/diffs
Hi,
I have recently switched to Ubuntu, and I discovered that my plugin is not able to open URLs in the external OS browser anymore.
Nothing happen when trying to open a URL, except this log (sorry, my OS is in french):
which can be translated by
We are using this API in our plugin:
Internally, this API is calling:
that doesn't seem to work well in my case, possibly because of the fact Firefox is now installed as a snap package in Ubuntu. FYI, this is the result of the
findProgram
call:I found a similar issue on Stack Overflow, but on my side Firefox seems to be correctly declared as default browser in the OS:
Interesting part of
/var/lib/snapd/desktop/applications/firefox_firefox.desktop
: