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

Side by Side Diff: adblock-android-webview/assets/hide.js

Issue 29782630: Issue 6000 - Rename "libadblockplus-android" (Closed)
Patch Set: Created May 15, 2018, 9:30 p.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 | « adblock-android-webview/assets/empty.js ('k') | adblock-android-webview/assets/inject.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 { 1 {
2 {{DEBUG}} console.log('started hiding elements'); 2 {{DEBUG}} console.log('started hiding elements');
3 var selectors = JSON.parse({{BRIDGE}}.getElemhideSelectors()); 3 var selectors = JSON.parse({{BRIDGE}}.getElemhideSelectors());
4 {{DEBUG}} console.log('parsed selectors: ' + selectors.length); 4 {{DEBUG}} console.log('parsed selectors: ' + selectors.length);
5 for (var i = 0; i < selectors.length; i++) 5 for (var i = 0; i < selectors.length; i++)
6 { 6 {
7 var selector = selectors[i]; 7 var selector = selectors[i];
8 if (selector[0] == '#') 8 if (selector[0] == '#')
9 { 9 {
10 var element = document.getElementById(selector.substr(1)); 10 var element = document.getElementById(selector.substr(1));
11 if (element != undefined) 11 if (element != undefined)
12 { 12 {
13 {{DEBUG}} console.log('elem blocked ' + selector); 13 {{DEBUG}} console.log('elem blocked ' + selector);
14 element.style.display = 'none'; 14 element.style.display = 'none';
15 }; 15 };
16 } 16 }
17 else 17 else
18 { 18 {
19 var elements = document.getElementsByClassName(selector.substr(1)); 19 var elements = document.getElementsByClassName(selector.substr(1));
20 for (var k=0; k < elements.length; k++) 20 for (var k=0; k < elements.length; k++)
21 { 21 {
22 {{DEBUG}} console.log('elem hidden ' + selector); 22 {{DEBUG}} console.log('elem hidden ' + selector);
23 elements[k].style.display = 'none'; 23 elements[k].style.display = 'none';
24 } 24 }
25 }; 25 };
26 }; 26 };
27 {{DEBUG}} console.log('finished hiding elements'); 27 {{DEBUG}} console.log('finished hiding elements');
28 }; 28 };
OLDNEW
« no previous file with comments | « adblock-android-webview/assets/empty.js ('k') | adblock-android-webview/assets/inject.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld