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

Unified Diff: lib/contentPolicy.js

Issue 29329754: Issue 3251 - Delegate processing of element hiding hits to shouldAllowAsync() so that hits show up (Closed)
Patch Set: Rebased Created Nov. 11, 2015, 5:47 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 | « lib/child/elemHide.js ('k') | lib/elemHide.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/contentPolicy.js
===================================================================
--- a/lib/contentPolicy.js
+++ b/lib/contentPolicy.js
@@ -96,17 +96,17 @@ var Policy = exports.Policy =
Utils.styleService.unregisterSheet(collapseStyle, Ci.nsIStyleSheetService.USER_SHEET);
});
},
/**
* Checks whether a node should be blocked, hides it if necessary
* @param {Object} data request data
* @param {String} data.contentType
- * @param {String} data.location
+ * @param {String} data.location location of the request, filter key if contentType is ELEMHIDE
* @param {Object[]} data.frames
* @param {Boolean} data.isPrivate true if the request belongs to a private browsing window
* @return {Object} An object containing properties block, collapse and hits
* indicating how this request should be handled.
*/
shouldAllow: function({contentType, location, frames, isPrivate})
{
let hits = [];
@@ -174,17 +174,17 @@ var Policy = exports.Policy =
if (frame == testSitekeyFrame)
[testSitekey, testSitekeyFrame] = getSitekey(frames.slice(i + 1));
}
}
if (!match && contentType == "ELEMHIDE")
{
- match = location;
+ match = ElemHide.getFilterByKey(location);
location = match.text.replace(/^.*?#/, '#');
if (!match.isActiveOnDomain(docDomain))
return response(true, false);
let exception = ElemHide.getException(match, docDomain);
if (exception)
{
« no previous file with comments | « lib/child/elemHide.js ('k') | lib/elemHide.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld