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

Unified Diff: lib/child/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. 12, 2015, 3:04 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/child/elemHide.js » ('j') | lib/child/elemHide.js » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/child/contentPolicy.js
===================================================================
--- a/lib/child/contentPolicy.js
+++ b/lib/child/contentPolicy.js
@@ -99,47 +99,47 @@ function processPolicyResponse(window, n
return allow;
}
/**
* Checks whether a request should be allowed, hides it if necessary
* @param {nsIDOMWindow} window
* @param {nsIDOMElement} node
* @param {String} contentType
- * @param {String} location
+ * @param {String} location location of the request, filter key if contentType is ELEMHIDE
* @return {Boolean} false if the request should be blocked
*/
-function shouldAllow(window, node, contentType, location)
+let shouldAllow = exports.shouldAllow = function(window, node, contentType, location)
{
return processPolicyResponse(window, node, sendSyncMessage("AdblockPlus:ShouldAllow", {
contentType,
location,
frames: getFrames(window),
isPrivate: isPrivate(window)
}));
-}
+};
/**
* Asynchronously checks whether a request should be allowed.
* @param {nsIDOMWindow} window
* @param {nsIDOMElement} node
* @param {String} contentType
- * @param {String} location
+ * @param {String} location location of the request, filter key if contentType is ELEMHIDE
* @param {Function} callback callback to be called with a boolean value, if
* false the request should be blocked
*/
-function shouldAllowAsync(window, node, contentType, location, callback)
+let shouldAllowAsync = exports.shouldAllowAsync = function(window, node, contentType, location, callback)
{
sendAsyncMessage("AdblockPlus:ShouldAllow", {
contentType,
location,
frames: getFrames(window),
isPrivate: isPrivate(window)
}, response => callback(processPolicyResponse(window, node, response)));
-}
+};
/**
* Actual nsIContentPolicy and nsIChannelEventSink implementation
* @class
*/
var PolicyImplementation =
{
classDescription: "Adblock Plus content policy",
« no previous file with comments | « no previous file | lib/child/elemHide.js » ('j') | lib/child/elemHide.js » ('J')

Powered by Google App Engine
This is Rietveld