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

Side by Side Diff: adblock-android-webview/assets/css.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/AndroidManifest.xml ('k') | adblock-android-webview/assets/empty.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('starting injecting css rules'); 2 {{DEBUG}} console.log('starting injecting css rules');
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 var head = document.getElementsByTagName("head")[0]; 5 var head = document.getElementsByTagName("head")[0];
6 var style = document.createElement("style"); 6 var style = document.createElement("style");
7 head.appendChild(style); 7 head.appendChild(style);
8 var sheet = style.sheet ? style.sheet : style.styleSheet; 8 var sheet = style.sheet ? style.sheet : style.styleSheet;
9 for (var i=0; i<selectors.length; i++) 9 for (var i=0; i<selectors.length; i++)
10 { 10 {
11 if (sheet.insertRule) 11 if (sheet.insertRule)
12 { 12 {
13 sheet.insertRule(selectors[i] + ' { display: none !important; }', 0); 13 sheet.insertRule(selectors[i] + ' { display: none !important; }', 0);
14 } 14 }
15 else 15 else
16 { 16 {
17 sheet.addRule(selectors[i], 'display: none !important;', 0); 17 sheet.addRule(selectors[i], 'display: none !important;', 0);
18 } 18 }
19 } 19 }
20 {{DEBUG}} console.log('finished injecting css rules'); 20 {{DEBUG}} console.log('finished injecting css rules');
21 } 21 }
OLDNEW
« no previous file with comments | « adblock-android-webview/AndroidManifest.xml ('k') | adblock-android-webview/assets/empty.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld