Index: lib/child/contentPolicy.js |
=================================================================== |
--- a/lib/child/contentPolicy.js |
+++ b/lib/child/contentPolicy.js |
@@ -65,20 +65,20 @@ let types = new Map(); |
function shouldAllow(window, node, contentType, location) |
{ |
let response = sendSyncMessage("AdblockPlus:ShouldAllow", { |
contentType: contentType, |
location: location, |
frames: getFrames(window), |
isPrivate: isPrivate(window) |
}); |
- if (response.length == 0) |
+ if (typeof response == "undefined") |
return true; |
- let {allow, collapse, hits} = response[0]; |
+ let {allow, collapse, hits} = response; |
for (let {frameIndex, contentType, docDomain, thirdParty, location, filter} of hits) |
{ |
let context = node; |
if (typeof frameIndex == "number") |
{ |
context = window; |
for (let i = 0; i < frameIndex; i++) |
context = context.parent; |
@@ -311,21 +311,17 @@ function schedulePostProcess(/**Element* |
} |
/** |
* Processes nodes scheduled for post-processing (typically hides them). |
*/ |
function postProcessNodes() |
{ |
if (!collapsedClass) |
- { |
- let response = sendSyncMessage("AdblockPlus:GetCollapsedClass"); |
- if (response.length) |
- collapsedClass = response[0]; |
- } |
+ collapsedClass = sendSyncMessage("AdblockPlus:GetCollapsedClass"); |
let nodes = scheduledNodes; |
scheduledNodes = null; |
if (!collapsedClass) |
return; |
for (let node of nodes) |