Browse Source

minor fix

Signed-off-by: Gerald <[email protected]>
Gerald 11 years ago
parent
commit
95b280578d
4 changed files with 9 additions and 5 deletions
  1. 2 3
      background.js
  2. 6 1
      injected.js
  3. 1 1
      style.less
  4. 0 0
      style.min.css

+ 2 - 3
background.js

@@ -674,10 +674,9 @@ function httpRequest(details,src,callback) {
     if(details.headers)
 			for(i in details.headers) {
 				v=details.headers[i];
-				if(special_headers.indexOf(i.toLowerCase())>=0) {
-					addSpecialHeader();
+				if(special_headers.indexOf(i.toLowerCase())>=0)
 					req.setRequestHeader('VM-'+i,v);
-				} else req.setRequestHeader(i,v);
+				else req.setRequestHeader(i,v);
 			}
 		if(details.responseType) req.responseType='blob';
     if(details.overrideMimeType) req.overrideMimeType(details.overrideMimeType);

+ 6 - 1
injected.js

@@ -426,8 +426,10 @@ function command(o){
 }
 
 // Requests
+var requests={};
 function getRequestId() {
 	chrome.runtime.sendMessage({cmd:'GetRequestId'},function(id){
+		requests[id]=1;
 		comm.post({cmd:'GotRequestId',data:id});
 	});
 }
@@ -435,7 +437,10 @@ function httpRequest(details) {
 	chrome.runtime.sendMessage({cmd:'HttpRequest',data:details});
 }
 function httpRequested(data) {
-	comm.post({cmd:'HttpRequested',data:data});
+	if(requests[data.id]) {
+		if(data.type=='loadend') delete requests[data.id];
+		comm.post({cmd:'HttpRequested',data:data});
+	}
 }
 function abortRequest(id) {
 	chrome.runtime.sendMessage({cmd:'AbortRequest',data:id});

+ 1 - 1
style.less

@@ -281,7 +281,7 @@ label>*{
 	padding: 10px;
 	box-sizing: border-box;
 	overflow-y: auto;
-	box-shadow: gray -2px 4px 4px;
+	box-shadow: -2px 4px 4px gray;
 	position: absolute;
 	table{
 		width: 100%;

File diff suppressed because it is too large
+ 0 - 0
style.min.css


Some files were not shown because too many files changed in this diff