Index: /applications/editors/josm/plugins/ywms/src/org/openstreetmap/josm/plugins/ywms/ImageLoader.java
===================================================================
--- /applications/editors/josm/plugins/ywms/src/org/openstreetmap/josm/plugins/ywms/ImageLoader.java	(revision 4016)
+++ /applications/editors/josm/plugins/ywms/src/org/openstreetmap/josm/plugins/ywms/ImageLoader.java	(revision 4017)
@@ -4,6 +4,5 @@
 import java.awt.image.*;
 import java.io.*;
-import java.net.MalformedURLException;
-import java.net.URL;
+import java.net.*;
 import java.util.ArrayList;
 import java.util.List;
@@ -52,5 +51,5 @@
 
 	/** THe yahoo URL request */
-	private URL yahooUrl;
+	private URI yahooUrl;
 	/** Original bounding box */
 	double[] orig_bbox = null;
@@ -81,8 +80,7 @@
 		System.out.println("YWMS::Requested WMS URL: " + wmsUrl);
 		try {
-			URL request = new URL("file:///page" + wmsUrl);
+			URI request = new URI("file:///page" + wmsUrl);
 			String query = request.getQuery().toLowerCase();
-			yahooUrl = new File(Util.getPluginDir(), "ymap.html").toURI().toURL();
-			yahooUrl = new URL( yahooUrl.toExternalForm() + "?" + query);
+			yahooUrl = new URI( "file", null, Util.getPluginDir() + "ymap.html", query, null);
 			
 			// Parse query to find original bounding box and dimensions
@@ -106,5 +104,5 @@
         	load();
 		} 
-		catch (MalformedURLException e) {
+		catch (URISyntaxException e) {
 			throw new ImageLoaderException(e);
 		}
@@ -154,8 +152,8 @@
 	            	firefoxFiles.add(file);
 	            	
-	            	URL browserUrl;
-	            	try {
-	            		browserUrl = new URL(url);	
-		            	if( browserUrl.sameFile(yahooUrl))
+	            	try 
+	            	{
+	            		URI browserUri = new URI(url);	
+		            	if( yahooUrl.getPath().equals(browserUri.getPath()))
 		            	{
 			            	String status = st.nextToken();
@@ -166,7 +164,5 @@
 			            	break;
 		            	}
-					} 
-	            	catch (MalformedURLException mue) 
-	            	{
+					} catch (URISyntaxException e) {
 						// Probably a mozilla "chrome://" URL. Do nothing
 					}
