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

Unified Diff: webrequest.js

Issue 8354161: Align whitelisting behavior in Chrome with Firefox (Closed)
Patch Set: Created Sept. 18, 2012, 3:14 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 | « 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
@@ -12,17 +12,17 @@ var frames = {};
function onBeforeRequest(details)
{
if (details.tabId == -1)
return {};
var type = details.type;
if (type == "main_frame" || type == "sub_frame")
- recordFrame(details.tabId, details.frameId, details.parentFrameId, details.url, type == "main_frame");
+ recordFrame(details.tabId, details.frameId, details.parentFrameId, details.url);
if (type == "main_frame")
return {};
// Type names match Mozilla's with main_frame and sub_frame being the only exceptions.
if (type == "sub_frame")
type = "SUBDOCUMENT";
else
@@ -56,17 +56,17 @@ function onBeforeSendHeaders(details)
{
headers.push({name: "DNT", value: "1"});
return {requestHeaders: headers};
}
}
return null;
}
-function recordFrame(tabId, frameId, parentFrameId, frameUrl, isMain)
+function recordFrame(tabId, frameId, parentFrameId, frameUrl)
{
if (!(tabId in frames))
frames[tabId] = {};
frames[tabId][frameId] = {url: frameUrl, parent: parentFrameId};
}
function getFrameUrl(tabId, frameId)
{
« no previous file with comments | « background.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld