karakun / OpenWebStart

Run Web Start based applications after the release of Java 11
https://openwebstart.com
Other
417 stars 48 forks source link

Enable jnlp:// and jnlps:// scheme in DEB-package #551

Open veldenb opened 1 year ago

veldenb commented 1 year ago

On Windows launching jnlp://somesite.com/test.jnlp works fine, but on Linux (Ubuntu 23.04) this doesn't work:

$ xdg-open jnlp://somesite.com/test.jnlp
gio: jnlp://somesite.com/test.jnlp: The specified location is not supported

It looks like the x-scheme-handler's for jnlp and jnlps are not registered.

I currently use the following workaround to alter the javaws.desktop file and register the scheme:

# Replace the %f parameter with %u for url handling
$ sed -i 's/%f/%u/g' /usr/share/applications/javaws.desktop

Alter ~/.config/mimeapps.list and add the following lines under [Default Applications]:

x-scheme-handler/jnlp=javaws.desktop
x-scheme-handler/jnlps=javaws.desktop

Opening the jnlp:// and jnlps:// uri's now works as they should:

$ xdg-open jnlp://somesite.com/test.jnlp
[ITW-CORE][2023-08-03 12:40:35.623 CEST][INFO ][com.openwebstart.launcher.OpenWebStartLauncher] OWS main args [jnlp://somesite.com/test.jnlp].
[ITW-CORE][2023-08-03 12:40:35.673 CEST][INFO ][com.openwebstart.launcher.PhaseTwoWebStartLauncher] Starting OpenWebStart 1.8.0
[ITW-CORE][2023-08-03 12:40:35.702 CEST][INFO ][net.sourceforge.jnlp.config.DeploymentConfiguration] Ico provider registered correctly.
[ITW-CORE][2023-08-03 12:40:35.731 CEST][INFO ][net.sourceforge.jnlp.config.DeploymentConfiguration] Ico provider registered correctly.
...

Is it possible to package the configuration of the scheme handler in the .deb package?