| Index: lib/child/contentPolicy.js |
| =================================================================== |
| --- a/lib/child/contentPolicy.js |
| +++ b/lib/child/contentPolicy.js |
| @@ -54,23 +54,23 @@ let collapsedClass = null; |
| */ |
| let types = new Map(); |
| /** |
| * Checks whether a request should be allowed, hides it if necessary |
| * @param wnd {nsIDOMWindow} |
| * @param node {nsIDOMElement} |
| * @param contentType {String} |
| - * @param location {String} |
| + * @param location {String} location of the request, filter key if contentType is ELEMHIDE |
| * @param [callback] {Function} If present, the request will be sent |
| * asynchronously and callback called with the |
| * response |
| * @return {Boolean} false if the request should be blocked |
| */ |
| -function shouldAllow(window, node, contentType, location, callback) |
| +let shouldAllow = exports.shouldAllow = function(window, node, contentType, location, callback) |
| { |
| function processResponse(response) |
| { |
| if (typeof response == "undefined") |
| return true; |
| let {allow, collapse, hits} = response; |
| for (let {frameIndex, contentType, docDomain, thirdParty, location, filter} of hits) |
| @@ -110,17 +110,17 @@ function shouldAllow(window, node, conte |
| if (typeof callback == "function") |
| { |
| sendAsyncMessage("AdblockPlus:ShouldAllow", data, (data) => { |
| callback(processResponse(data)); |
| }); |
| } |
| else |
| return processResponse(sendSyncMessage("AdblockPlus:ShouldAllow", data)); |
| -} |
| +}; |
| /** |
| * Actual nsIContentPolicy and nsIChannelEventSink implementation |
| * @class |
| */ |
| var PolicyImplementation = |
| { |
| classDescription: "Adblock Plus content policy", |