Explorar o código

possible bug with nested frames fixed

Gildas lormeau %!s(int64=15) %!d(string=hai) anos
pai
achega
0dc536b1c3
Modificáronse 2 ficheiros con 6 adicións e 11 borrados
  1. 1 1
      WebContent/manifest.json
  2. 5 10
      WebContent/scripts/background.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.0.87",
+	"version": "0.0.88",
 	"description": "SingleFile helps you to archive a complete page into a single HTML file",
 	"background_page" : "pages/background.html",
 	"options_page": "pages/options.html",

+ 5 - 10
WebContent/scripts/background.js

@@ -150,14 +150,6 @@ var singlefile = {};
 			return parentPort;
 		}
 
-		function build(portData) {
-			portData.parent = findParent(portData);
-			if (portData.parent) {
-				portData.parent.children = portData.parent.children || [];
-				portData.parent.children.push(portData);
-			}
-		}
-
 		function walk(portData, level) {
 			if (portData.children)
 				portData.children.forEach(function(pData) {
@@ -169,8 +161,11 @@ var singlefile = {};
 		}
 
 		tabData.ports.forEach(function(portData) {
-			if (!portData.frameCount)
-				build(portData, 0);
+			portData.parent = findParent(portData);
+			if (portData.parent) {
+				portData.parent.children = portData.parent.children || [];
+				portData.parent.children.push(portData);
+			}
 		});
 		tabData.levels = [];
 		walk(tabData.top, 0);