LEFT | RIGHT |
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-present eyeo GmbH | 3 * Copyright (C) 2006-present 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 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
494 | 494 |
495 if (this.style && this.style.parentElement) | 495 if (this.style && this.style.parentElement) |
496 this.style.parentElement.removeChild(this.style); | 496 this.style.parentElement.removeChild(this.style); |
497 this.style = null; | 497 this.style = null; |
498 | 498 |
499 if (response.trace) | 499 if (response.trace) |
500 this.tracer = new ElementHidingTracer(); | 500 this.tracer = new ElementHidingTracer(); |
501 | 501 |
502 this.inject = response.inject; | 502 this.inject = response.inject; |
503 | 503 |
504 if (response.selectors) | 504 if (this.inject) |
505 { | 505 this.addSelectors(response.selectors); |
506 if (this.inject) | 506 else if (this.tracer) |
507 this.addSelectors(response.selectors); | 507 this.tracer.addSelectors(response.selectors); |
508 else if (this.tracer) | |
509 this.tracer.addSelectors(response.selectors); | |
510 } | |
511 | 508 |
512 this.elemHideEmulation.apply(); | 509 this.elemHideEmulation.apply(); |
513 }); | 510 }); |
514 } | 511 } |
515 }; | 512 }; |
516 | 513 |
517 if (document instanceof HTMLDocument) | 514 if (document instanceof HTMLDocument) |
518 { | 515 { |
519 checkSitekey(); | 516 checkSitekey(); |
520 | 517 |
521 elemhide = new ElemHide(); | 518 elemhide = new ElemHide(); |
522 elemhide.apply(); | 519 elemhide.apply(); |
523 | 520 |
524 document.addEventListener("error", event => | 521 document.addEventListener("error", event => |
525 { | 522 { |
526 checkCollapse(event.target); | 523 checkCollapse(event.target); |
527 }, true); | 524 }, true); |
528 | 525 |
529 document.addEventListener("load", event => | 526 document.addEventListener("load", event => |
530 { | 527 { |
531 let element = event.target; | 528 let element = event.target; |
532 if (/^i?frame$/.test(element.localName)) | 529 if (/^i?frame$/.test(element.localName)) |
533 checkCollapse(element); | 530 checkCollapse(element); |
534 }, true); | 531 }, true); |
535 } | 532 } |
LEFT | RIGHT |