diff --git a/src/org/openstreetmap/josm/tools/OpenBrowser.java b/src/org/openstreetmap/josm/tools/OpenBrowser.java
index 083de23d1..739e3c92f 100644
|
a
|
b
|
public static String displayUrl(URI uri) {
|
| 42 | 42 | |
| 43 | 43 | if (Desktop.isDesktopSupported()) { |
| 44 | 44 | try { |
| 45 | | if (PlatformManager.isPlatformWindows()) { |
| 46 | | // Desktop API works fine under Windows, so we don't try any fallback in case of I/O exceptions because it's not API's fault |
| 47 | | Desktop.getDesktop().browse(uri); |
| 48 | | } else if (PlatformManager.isPlatformUnixoid() || PlatformManager.isPlatformOsx()) { |
| | 45 | if (PlatformManager.isPlatformWindows() || PlatformManager.isPlatformUnixoid() || PlatformManager.isPlatformOsx()) { |
| 49 | 46 | // see #5629 #5108 #9568 |
| 50 | 47 | PlatformManager.getPlatform().openUrl(uri.toString()); |
| 51 | 48 | } else { |
diff --git a/src/org/openstreetmap/josm/tools/PlatformHookWindows.java b/src/org/openstreetmap/josm/tools/PlatformHookWindows.java
index 2a9d46f35..230856541 100644
|
a
|
b
|
|
| 30 | 30 | import static org.openstreetmap.josm.tools.Utils.getSystemProperty; |
| 31 | 31 | import static org.openstreetmap.josm.tools.WinRegistry.HKEY_LOCAL_MACHINE; |
| 32 | 32 | |
| 33 | | import java.awt.GraphicsEnvironment; |
| | 33 | import java.awt.*; |
| 34 | 34 | import java.io.BufferedWriter; |
| 35 | 35 | import java.io.File; |
| 36 | 36 | import java.io.IOException; |
| … |
… |
|
| 39 | 39 | import java.io.OutputStreamWriter; |
| 40 | 40 | import java.io.Writer; |
| 41 | 41 | import java.lang.reflect.InvocationTargetException; |
| | 42 | import java.net.URI; |
| | 43 | import java.net.URISyntaxException; |
| 42 | 44 | import java.nio.charset.StandardCharsets; |
| 43 | 45 | import java.nio.file.DirectoryIteratorException; |
| 44 | 46 | import java.nio.file.DirectoryStream; |
| … |
… |
public void startupHook(JavaExpirationCallback callback) {
|
| 187 | 189 | |
| 188 | 190 | @Override |
| 189 | 191 | public void openUrl(String url) throws IOException { |
| 190 | | Runtime.getRuntime().exec(new String[]{"rundll32", "url.dll,FileProtocolHandler", url}); |
| | 192 | final String customBrowser = Config.getPref().get("browser.windows", null); |
| | 193 | if (customBrowser != null) { |
| | 194 | Runtime.getRuntime().exec(new String[]{customBrowser, url}); |
| | 195 | return; |
| | 196 | } |
| | 197 | try { |
| | 198 | // Desktop API works fine under Windows |
| | 199 | Desktop.getDesktop().browse(new URI(url)); |
| | 200 | } catch (IOException | URISyntaxException e) { |
| | 201 | Logging.log(Logging.LEVEL_WARN, "Desktop class failed. Platform dependent fall back for open url in browser.", e); |
| | 202 | Runtime.getRuntime().exec(new String[]{"rundll32", "url.dll,FileProtocolHandler", url}); |
| | 203 | } |
| 191 | 204 | } |
| 192 | 205 | |
| 193 | 206 | @Override |