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

Unified Diff: background.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 | « no previous file | webrequest.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: background.js
===================================================================
--- a/background.js
+++ b/background.js
@@ -46,17 +46,18 @@ function setDefaultOptions()
delete localStorage.experimental;
}
// Upgrade options before we do anything else.
setDefaultOptions();
/**
* Checks whether a page is whitelisted.
- * @param url {String}
+ * @param {String} url
+ * @param {String} [type] content type to be checked, default is "DOCUMENT"
* @return {Filter} filter that matched the URL or null if not whitelisted
*/
function isWhitelisted(url, type)
{
// Ignore fragment identifier
var index = url.indexOf("#");
if (index >= 0)
url = url.substring(0, index);
@@ -358,17 +359,17 @@ chrome.extension.onRequest.addListener(f
var selectors = null;
// HACK: We don't know which frame sent us the message, try to find it
// in webRequest's frame data.
var tabId = -1;
var frameId = -1;
if (sender.tab)
{
- var tabId = sender.tab.id;
+ tabId = sender.tab.id;
if (tabId in frames)
{
for (var f in frames[tabId])
{
if (getFrameUrl(tabId, f) == request.frameUrl)
{
frameId = f;
break;
« no previous file with comments | « no previous file | webrequest.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld