Index: /trunk/src/org/openstreetmap/josm/gui/MainApplication.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/MainApplication.java	(revision 10930)
+++ /trunk/src/org/openstreetmap/josm/gui/MainApplication.java	(revision 10931)
@@ -57,4 +57,5 @@
 import org.openstreetmap.josm.io.auth.CredentialsManager;
 import org.openstreetmap.josm.io.auth.DefaultAuthenticator;
+import org.openstreetmap.josm.io.protocols.data.Handler;
 import org.openstreetmap.josm.io.remotecontrol.RemoteControl;
 import org.openstreetmap.josm.plugins.PluginHandler;
@@ -260,4 +261,6 @@
         I18n.setupLanguageFonts();
 
+        Handler.install();
+
         WindowGeometry geometry = WindowGeometry.mainWindow("gui.geometry",
                 args.getSingle(Option.GEOMETRY).orElse(null),
Index: /trunk/src/org/openstreetmap/josm/gui/widgets/NativeFileChooser.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/widgets/NativeFileChooser.java	(revision 10930)
+++ /trunk/src/org/openstreetmap/josm/gui/widgets/NativeFileChooser.java	(revision 10931)
@@ -12,4 +12,5 @@
 
 import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.tools.Utils;
 
 /**
@@ -135,5 +136,5 @@
         boolean appleProperty = Main.isPlatformOsx() && selectionMode == JFileChooser.DIRECTORIES_ONLY;
         if (appleProperty) {
-            System.setProperty("apple.awt.fileDialogForDirectories", "true");
+            Utils.updateSystemProperty("apple.awt.fileDialogForDirectories", "true");
         }
         try {
@@ -144,5 +145,5 @@
         } finally {
             if (appleProperty) {
-                System.setProperty("apple.awt.fileDialogForDirectories", "false");
+                Utils.updateSystemProperty("apple.awt.fileDialogForDirectories", "false");
             }
         }
Index: /trunk/src/org/openstreetmap/josm/io/protocols/data/DataConnection.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/protocols/data/DataConnection.java	(revision 10931)
+++ /trunk/src/org/openstreetmap/josm/io/protocols/data/DataConnection.java	(revision 10931)
@@ -0,0 +1,36 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.io.protocols.data;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.net.URLConnection;
+import java.util.Base64;
+
+/**
+ * Connection for "data:" protocol allowing to read inlined base64 images.
+ * <p>
+ * See <a href="http://stackoverflow.com/a/9388757/2257172">StackOverflow</a>.
+ * @since 10931
+ */
+public class DataConnection extends URLConnection {
+
+    /**
+     * Constructs a new {@code DataConnection}.
+     * @param u data url
+     */
+    public DataConnection(URL u) {
+        super(u);
+    }
+
+    @Override
+    public void connect() throws IOException {
+        connected = true;
+    }
+
+    @Override
+    public InputStream getInputStream() throws IOException {
+        return new ByteArrayInputStream(Base64.getDecoder().decode(url.toString().replaceFirst("^.*;base64,", "")));
+    }
+}
Index: /trunk/src/org/openstreetmap/josm/io/protocols/data/Handler.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/protocols/data/Handler.java	(revision 10931)
+++ /trunk/src/org/openstreetmap/josm/io/protocols/data/Handler.java	(revision 10931)
@@ -0,0 +1,41 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.io.protocols.data;
+
+import java.io.IOException;
+import java.net.URL;
+import java.net.URLConnection;
+import java.net.URLStreamHandler;
+
+import org.openstreetmap.josm.tools.Utils;
+
+/**
+ * Protocol handler for {@code data:} URLs.
+ * This class must be named "Handler" and in a package "data" (fixed named convention)!
+ * <p>
+ * See <a href="http://stackoverflow.com/a/9388757/2257172">StackOverflow</a>.
+ * @since 10931
+ */
+public class Handler extends URLStreamHandler {
+
+    @Override
+    protected URLConnection openConnection(URL u) throws IOException {
+        return new DataConnection(u);
+    }
+
+    /**
+     * Installs protocol handler.
+     */
+    public static void install() {
+        String pkgName = Handler.class.getPackage().getName();
+        String pkg = pkgName.substring(0, pkgName.lastIndexOf('.'));
+
+        String protocolHandlers = System.getProperty("java.protocol.handler.pkgs", "");
+        if (!protocolHandlers.contains(pkg)) {
+            if (!protocolHandlers.isEmpty()) {
+                protocolHandlers += "|";
+            }
+            protocolHandlers += pkg;
+            Utils.updateSystemProperty("java.protocol.handler.pkgs", protocolHandlers);
+        }
+    }
+}
Index: /trunk/src/org/openstreetmap/josm/io/protocols/data/package-info.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/protocols/data/package-info.java	(revision 10931)
+++ /trunk/src/org/openstreetmap/josm/io/protocols/data/package-info.java	(revision 10931)
@@ -0,0 +1,9 @@
+// License: GPL. For details, see LICENSE file.
+
+/**
+ * Provides the classes for registering a protocol handler for "data:".
+ * <p>
+ * See <a href="http://stackoverflow.com/a/9388757/2257172">StackOverflow</a>.
+ * @since 10931
+ */
+package org.openstreetmap.josm.io.protocols.data;
Index: /trunk/src/org/openstreetmap/josm/tools/Utils.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/tools/Utils.java	(revision 10930)
+++ /trunk/src/org/openstreetmap/josm/tools/Utils.java	(revision 10931)
@@ -1316,8 +1316,10 @@
         if (value != null) {
             String old = System.setProperty(key, value);
-            if (!key.toLowerCase(Locale.ENGLISH).contains("password")) {
-                Main.debug("System property '" + key + "' set to '" + value + "'. Old value was '" + old + '\'');
-            } else {
-                Main.debug("System property '" + key + "' changed.");
+            if (Main.isDebugEnabled()) {
+                if (!key.toLowerCase(Locale.ENGLISH).contains("password")) {
+                    Main.debug("System property '" + key + "' set to '" + value + "'. Old value was '" + old + '\'');
+                } else {
+                    Main.debug("System property '" + key + "' changed.");
+                }
             }
             return old;
Index: /trunk/test/unit/org/openstreetmap/josm/io/protocols/data/HandlerTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/io/protocols/data/HandlerTest.java	(revision 10931)
+++ /trunk/test/unit/org/openstreetmap/josm/io/protocols/data/HandlerTest.java	(revision 10931)
@@ -0,0 +1,47 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.io.protocols.data;
+
+import static org.junit.Assert.assertNotNull;
+
+import java.io.IOException;
+import java.net.URL;
+import java.net.URLConnection;
+
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.openstreetmap.josm.testutils.JOSMTestRules;
+
+/**
+ * Unit tests of {@link Handler} class.
+ */
+public class HandlerTest {
+
+    /**
+     * Use the test rules to remove any layers and reset state.
+     */
+    @Rule
+    public final JOSMTestRules rules = new JOSMTestRules();
+
+    /**
+     * Setup test.
+     */
+    @Before
+    public void setUp() {
+        Handler.install();
+    }
+
+    /**
+     * Reads a base-64 image.
+     * @throws IOException if any I/O error occurs
+     */
+    @Test
+    public void testBase64Image() throws IOException {
+        // Red dot image, taken from https://en.wikipedia.org/wiki/Data_URI_scheme#HTML
+        URLConnection connection = new Handler().openConnection(new URL("data:image/png;base64," +
+                "iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4"+
+                "//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg=="));
+        connection.connect();
+        assertNotNull(connection.getInputStream());
+    }
+}
