Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: include.preload.js

Issue 29737561: Issue 6539, 6782 - Implement support for snippets (Closed) Base URL: https://hg.adblockplus.org/adblockpluschrome/
Patch Set: Rebase, simplify, execute script on "snippets.executeScripts" message Created May 23, 2018, 5:06 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | lib/scriptInjection.js » ('j') | lib/scriptInjection.js » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 574 matching lines...) Expand 10 before | Expand all | Expand 10 after
585 585
586 this.elemHideEmulation.apply(response.emulatedPatterns); 586 this.elemHideEmulation.apply(response.emulatedPatterns);
587 }); 587 });
588 } 588 }
589 }; 589 };
590 590
591 if (document instanceof HTMLDocument) 591 if (document instanceof HTMLDocument)
592 { 592 {
593 checkSitekey(); 593 checkSitekey();
594 594
595 browser.runtime.sendMessage({type: "snippets.executeScripts"});
Manish Jethani 2018/05/23 05:12:45 Send message to background page to execute any scr
Sebastian Noack 2018/05/23 12:32:18 How about using a combined message for element hid
Manish Jethani 2018/07/19 01:00:53 Done. The ElemHide class is now renamed to Conten
596
595 elemhide = new ElemHide(); 597 elemhide = new ElemHide();
596 elemhide.apply(); 598 elemhide.apply();
597 599
598 document.addEventListener("error", event => 600 document.addEventListener("error", event =>
599 { 601 {
600 checkCollapse(event.target); 602 checkCollapse(event.target);
601 }, true); 603 }, true);
602 604
603 document.addEventListener("load", event => 605 document.addEventListener("load", event =>
604 { 606 {
605 let element = event.target; 607 let element = event.target;
606 if (/^i?frame$/.test(element.localName)) 608 if (/^i?frame$/.test(element.localName))
607 checkCollapse(element); 609 checkCollapse(element);
608 }, true); 610 }, true);
609 } 611 }
610 612
611 window.checkCollapse = checkCollapse; 613 window.checkCollapse = checkCollapse;
612 window.elemhide = elemhide; 614 window.elemhide = elemhide;
613 window.typeMap = typeMap; 615 window.typeMap = typeMap;
614 window.getURLsFromElement = getURLsFromElement; 616 window.getURLsFromElement = getURLsFromElement;
OLDNEW
« no previous file with comments | « no previous file | lib/scriptInjection.js » ('j') | lib/scriptInjection.js » ('J')

Powered by Google App Engine
This is Rietveld