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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 * @param {Object|undefined} response object received as response | 61 * @param {Object|undefined} response object received as response |
62 * @return {Boolean} false if the request should be blocked | 62 * @return {Boolean} false if the request should be blocked |
63 */ | 63 */ |
64 function processPolicyResponse(window, node, response) | 64 function processPolicyResponse(window, node, response) |
65 { | 65 { |
66 if (typeof response == "undefined") | 66 if (typeof response == "undefined") |
67 return true; | 67 return true; |
68 | 68 |
69 let {allow, collapse, hits} = response; | 69 let {allow, collapse, hits} = response; |
70 let isObject = false; | 70 let isObject = false; |
71 for (let {frameIndex, contentType, docDomain, thirdParty, location, filter} of
hits) | 71 for (let hit of hits) |
72 { | 72 { |
73 if (contentType == "OBJECT") | 73 if (hit.contentType == "OBJECT") |
74 isObject = true; | 74 isObject = true; |
75 | 75 |
76 let context = node; | 76 let context = node; |
77 if (typeof frameIndex == "number") | 77 if (typeof hit.frameIndex == "number") |
78 { | 78 { |
79 context = window; | 79 context = window; |
80 for (let i = 0; i < frameIndex; i++) | 80 for (let i = 0; i < hit.frameIndex; i++) |
81 context = context.parent; | 81 context = context.parent; |
82 context = context.document; | 82 context = context.document; |
83 } | 83 } |
84 RequestNotifier.addNodeData(context, window.top, contentType, docDomain, thi
rdParty, location, filter); | 84 RequestNotifier.addNodeData(context, window.top, hit); |
85 } | 85 } |
86 | 86 |
87 if (node.nodeType == Ci.nsIDOMNode.ELEMENT_NODE) | 87 if (node.nodeType == Ci.nsIDOMNode.ELEMENT_NODE) |
88 { | 88 { |
89 // Track mouse events for objects | 89 // Track mouse events for objects |
90 if (allow && isObject) | 90 if (allow && isObject) |
91 { | 91 { |
92 node.addEventListener("mouseover", objectMouseEventHander, true); | 92 node.addEventListener("mouseover", objectMouseEventHander, true); |
93 node.addEventListener("mouseout", objectMouseEventHander, true); | 93 node.addEventListener("mouseout", objectMouseEventHander, true); |
94 } | 94 } |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 let property = (hasCols ? "cols" : "rows"); | 379 let property = (hasCols ? "cols" : "rows"); |
380 let weights = parentNode[property].split(","); | 380 let weights = parentNode[property].split(","); |
381 weights[index] = "0"; | 381 weights[index] = "0"; |
382 parentNode[property] = weights.join(","); | 382 parentNode[property] = weights.join(","); |
383 } | 383 } |
384 } | 384 } |
385 else | 385 else |
386 node.classList.add(collapsedClass); | 386 node.classList.add(collapsedClass); |
387 } | 387 } |
388 } | 388 } |
OLD | NEW |