Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: include.preload.js

Issue 29347167: Issue 4210 - Fix dynamic-frame collapsing in Chrome (Closed)
Patch Set: Created June 30, 2016, 1:39 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | lib/requestBlocker.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include.preload.js
diff --git a/include.preload.js b/include.preload.js
index 949d039663f9130843b4d8d0a3ddfcb434522066..ba13743032bb25de59b5a31fc12d4cc28f4d80ed 100644
--- a/include.preload.js
+++ b/include.preload.js
@@ -126,7 +126,7 @@ function getURLsFromElement(element)
return urls;
}
-function checkCollapse(element)
+function checkCollapse(element, contentDocument)
{
window.collapsing = true;
@@ -138,14 +138,17 @@ function checkCollapse(element)
if (urls.length == 0)
return;
- ext.backgroundPage.sendMessage(
- {
- type: "filters.collapse",
- urls: urls,
- mediatype: mediatype,
- baseURL: document.location.href
- },
+ var message = {
+ type: "filters.collapse",
+ urls: urls,
+ mediatype: mediatype,
+ baseURL: document.location.href
+ };
+
+ if (contentDocument)
+ message.dynamicFrameURL = contentDocument.location.href;
+ ext.backgroundPage.sendMessage(message,
function(collapse)
{
function collapseElement()
@@ -556,7 +559,10 @@ function init(document)
if (!contentWindow.collapsing)
Sebastian Noack 2016/08/10 12:38:52 I'd rather remove this workaround than adding yet
Array.prototype.forEach.call(
contentDocument.querySelectorAll(Object.keys(typeMap).join(",")),
- checkCollapse
+ function(element)
+ {
+ checkCollapse(element, contentDocument);
+ }
);
}
}
« no previous file with comments | « no previous file | lib/requestBlocker.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld