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

Unified Diff: webrequest.js

Issue 8792018: Topic 11477 - Whitelisting doesn`t deal with frames correctly (Closed)
Patch Set: Created Nov. 6, 2012, 11:05 a.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 | « background.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrequest.js
===================================================================
--- a/webrequest.js
+++ b/webrequest.js
@@ -176,20 +176,24 @@ function checkRequest(type, tabId, url,
var documentHost = extractHostFromURL(documentUrl);
var thirdParty = isThirdParty(requestHost, documentHost);
return defaultMatcher.matchesAny(url, type, documentHost, thirdParty);
}
function isFrameWhitelisted(tabId, frameId, type)
{
var parent = frameId;
- while (parent != -1)
+ var parentData = getFrameData(tabId, parent);
+ while (parentData)
{
- var parentData = getFrameData(tabId, parent);
- if (!parentData)
- break;
+ var frame = parent;
+ var frameData = parentData;
- if (isWhitelisted(parentData.url, type) || "keyException" in parentData)
+ parent = frameData.parent;
+ parentData = getFrameData(tabId, parent);
+
+ var frameUrl = frameData.url;
+ var parentUrl = (parentData ? parentData.url : frameUrl);
+ if ("keyException" in frameData || isWhitelisted(frameUrl, parentUrl, type))
return true;
- parent = parentData.parent;
}
return false;
}
« no previous file with comments | « background.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld