OLD | NEW |
1 /* | 1 /* |
2 * This file is part of Adblock Plus <https://adblockplus.org/>, | 2 * This file is part of Adblock Plus <https://adblockplus.org/>, |
3 * Copyright (C) 2006-2015 Eyeo GmbH | 3 * Copyright (C) 2006-2015 Eyeo GmbH |
4 * | 4 * |
5 * Adblock Plus is free software: you can redistribute it and/or modify | 5 * Adblock Plus is free software: you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 3 as | 6 * it under the terms of the GNU General Public License version 3 as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
8 * | 8 * |
9 * Adblock Plus is distributed in the hope that it will be useful, | 9 * Adblock Plus is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 * @return {Boolean} false if the request should be blocked | 66 * @return {Boolean} false if the request should be blocked |
67 */ | 67 */ |
68 let shouldAllow = exports.shouldAllow = function(window, node, contentType, loca
tion, callback) | 68 let shouldAllow = exports.shouldAllow = function(window, node, contentType, loca
tion, callback) |
69 { | 69 { |
70 function processResponse(response) | 70 function processResponse(response) |
71 { | 71 { |
72 if (typeof response == "undefined") | 72 if (typeof response == "undefined") |
73 return true; | 73 return true; |
74 | 74 |
75 let {allow, collapse, hits} = response; | 75 let {allow, collapse, hits} = response; |
76 for (let {frameIndex, contentType, docDomain, thirdParty, location, filter}
of hits) | 76 for (let hit of hits) |
77 { | 77 { |
78 let context = node; | 78 let context = node; |
79 if (typeof frameIndex == "number") | 79 if (typeof hit.frameIndex == "number") |
80 { | 80 { |
81 context = window; | 81 context = window; |
82 for (let i = 0; i < frameIndex; i++) | 82 for (let i = 0; i < hit.frameIndex; i++) |
83 context = context.parent; | 83 context = context.parent; |
84 context = context.document; | 84 context = context.document; |
85 } | 85 } |
86 RequestNotifier.addNodeData(context, window.top, contentType, docDomain, t
hirdParty, location, filter); | 86 RequestNotifier.addNodeData(context, window.top, hit); |
87 } | 87 } |
88 | 88 |
89 if (node.nodeType == Ci.nsIDOMNode.ELEMENT_NODE) | 89 if (node.nodeType == Ci.nsIDOMNode.ELEMENT_NODE) |
90 { | 90 { |
91 // Track mouse events for objects | 91 // Track mouse events for objects |
92 if (allow && contentType == "OBJECT") | 92 if (allow && contentType == "OBJECT") |
93 { | 93 { |
94 node.addEventListener("mouseover", objectMouseEventHander, true); | 94 node.addEventListener("mouseover", objectMouseEventHander, true); |
95 node.addEventListener("mouseout", objectMouseEventHander, true); | 95 node.addEventListener("mouseout", objectMouseEventHander, true); |
96 } | 96 } |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 let property = (hasCols ? "cols" : "rows"); | 367 let property = (hasCols ? "cols" : "rows"); |
368 let weights = parentNode[property].split(","); | 368 let weights = parentNode[property].split(","); |
369 weights[index] = "0"; | 369 weights[index] = "0"; |
370 parentNode[property] = weights.join(","); | 370 parentNode[property] = weights.join(","); |
371 } | 371 } |
372 } | 372 } |
373 else | 373 else |
374 node.classList.add(collapsedClass); | 374 node.classList.add(collapsedClass); |
375 } | 375 } |
376 } | 376 } |
OLD | NEW |