Commits

unknown  committed 501caff

Added handling for the case where file urls have query parameters

  • Participants
  • Parent commits 22f2d98

Comments (0)

Files changed (2)

File FileUrlProject.js

 	this.projectUrls = {};
 };
 FileUrlProject.prototype = {
-	filePathForUrl : function(url){
+	filePathForUrl : function(rawUrl){
+		// strip the query string assuming that not many people put 
+		// question marks in their file names
+		var url = rawUrl.split("?")[0];
+		
 		if (url.indexOf('file://') == 0){
 			var path;
 			if (url.indexOf('localhost') == 7){
 			if (navigator.platform.indexOf('Win') == 0 && path.charAt(0) == '/'){
 				path = path.substring(1);
 			}
-			this.projectUrls[path] = url;
+			this.projectUrls[path] = rawUrl;
 			return path;
 		}
 		return null;

File FileWatcher.js

 					if (url.indexOf('localhost') == 7){
 						startIdx = 16;
 					}
-					Gito.FileUtils.readFile(self.fsRoot, url.substring(startIdx), 'Text', sendContentToDevtools, done);
+					// strip the query string assuming that not many people put 
+					// question marks in their file names
+					var strippedUrl = url.split("?")[0]
+					Gito.FileUtils.readFile(self.fsRoot, strippedUrl.substring(startIdx), 'Text', sendContentToDevtools, done);
 				}
 				else{
 					$.ajax({type: 'GET',