Quellcode durchsuchen

bug fix : since css external stylesheets are inserted into the page without encoding, text/html media type is not allowed

Gildas lormeau vor 15 Jahren
Ursprung
Commit
b66618869d
2 geänderte Dateien mit 5 neuen und 1 gelöschten Zeilen
  1. 1 1
      WebContent/manifest.json
  2. 4 0
      WebContent/scripts/filters.js

+ 1 - 1
WebContent/manifest.json

@@ -4,7 +4,7 @@
 		"16": "resources/icon_16.png",
 		"48": "resources/icon_48.png",
 		"128": "resources/icon_128.png" },
-	"version": "0.1.2",
+	"version": "0.1.3",
 	"description": "SingleFile helps you to archive a complete page into a single HTML file",
 	"background_page" : "pages/background.html",
 	"options_page": "pages/options.html",

+ 4 - 0
WebContent/scripts/filters.js

@@ -314,6 +314,10 @@
 					if (node.href.indexOf("data:") != 0)
 						sendRequest(node.href, function(data) {
 							var i, newNode;
+							if (data.mediaType == "text/html") {
+								node.parentElement.removeChild(node);
+								return;
+							}
 							newNode = targetDoc.createElement("style");
 							for (i = 0; i < node.attributes.length; i++)
 								if (node.attributes[i].value)