| 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 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 * @param {Node[]} nodes | 311 * @param {Node[]} nodes |
| 312 * @param {RequestEntry} entry | 312 * @param {RequestEntry} entry |
| 313 */ | 313 */ |
| 314 refilterNodes: function(nodes, entry) | 314 refilterNodes: function(nodes, entry) |
| 315 { | 315 { |
| 316 // Ignore nodes that have been blocked already | 316 // Ignore nodes that have been blocked already |
| 317 if (entry.filter && !(entry.filter instanceof WhitelistFilter)) | 317 if (entry.filter && !(entry.filter instanceof WhitelistFilter)) |
| 318 return; | 318 return; |
| 319 | 319 |
| 320 for (let node of nodes) | 320 for (let node of nodes) |
| 321 Utils.runAsync(refilterNode, this, node, entry); | 321 Utils.runAsync(() => refilterNode(node, entry)); |
| 322 } | 322 } |
| 323 }; | 323 }; |
| 324 Policy.init(); | 324 Policy.init(); |
| 325 | 325 |
| 326 /** | 326 /** |
| 327 * Actual nsIContentPolicy and nsIChannelEventSink implementation | 327 * Actual nsIContentPolicy and nsIChannelEventSink implementation |
| 328 * @class | 328 * @class |
| 329 */ | 329 */ |
| 330 let PolicyImplementation = | 330 let PolicyImplementation = |
| 331 { | 331 { |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 453 { | 453 { |
| 454 case "content-document-global-created": | 454 case "content-document-global-created": |
| 455 { | 455 { |
| 456 if (!(subject instanceof Ci.nsIDOMWindow) || !subject.opener) | 456 if (!(subject instanceof Ci.nsIDOMWindow) || !subject.opener) |
| 457 return; | 457 return; |
| 458 | 458 |
| 459 let uri = additional || Utils.makeURI(subject.location.href); | 459 let uri = additional || Utils.makeURI(subject.location.href); |
| 460 if (!Policy.processNode(subject.opener, subject.opener.document, Policy.
type.POPUP, uri, false)) | 460 if (!Policy.processNode(subject.opener, subject.opener.document, Policy.
type.POPUP, uri, false)) |
| 461 { | 461 { |
| 462 subject.stop(); | 462 subject.stop(); |
| 463 Utils.runAsync(subject.close, subject); | 463 Utils.runAsync(() => subject.close()); |
| 464 } | 464 } |
| 465 else if (uri.spec == "about:blank") | 465 else if (uri.spec == "about:blank") |
| 466 { | 466 { |
| 467 // An about:blank pop-up most likely means that a load will be | 467 // An about:blank pop-up most likely means that a load will be |
| 468 // initiated synchronously. Set a flag for our "http-on-opening-reques
t" | 468 // initiated synchronously. Set a flag for our "http-on-opening-reques
t" |
| 469 // handler. | 469 // handler. |
| 470 this.expectingPopupLoad = true; | 470 this.expectingPopupLoad = true; |
| 471 Utils.runAsync(function() | 471 Utils.runAsync(function() |
| 472 { | 472 { |
| 473 this.expectingPopupLoad = false; | 473 this.expectingPopupLoad = false; |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 786 if (!wnd || wnd.closed) | 786 if (!wnd || wnd.closed) |
| 787 return; | 787 return; |
| 788 | 788 |
| 789 if (entry.type == Policy.type.OBJECT) | 789 if (entry.type == Policy.type.OBJECT) |
| 790 { | 790 { |
| 791 node.removeEventListener("mouseover", objectMouseEventHander, true); | 791 node.removeEventListener("mouseover", objectMouseEventHander, true); |
| 792 node.removeEventListener("mouseout", objectMouseEventHander, true); | 792 node.removeEventListener("mouseout", objectMouseEventHander, true); |
| 793 } | 793 } |
| 794 Policy.processNode(wnd, node, entry.type, Utils.makeURI(entry.location), true)
; | 794 Policy.processNode(wnd, node, entry.type, Utils.makeURI(entry.location), true)
; |
| 795 } | 795 } |
| OLD | NEW |