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

Delta Between Two Patch Sets: libadblockplus-android-webview/assets/inject.js

Issue 29351744: Issue 4399 - Add WebView inheritor with ad blocking (Closed)
Left Patch Set: moved from experimental gradle plugin to standard one (with new ndk support) Created Oct. 7, 2016, 9:48 a.m.
Right Patch Set: changed packages, now using AdblockEngine (original ABPEngine), improved demo app Created Oct. 25, 2016, 11:20 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « libadblockplus-android-webview/assets/hide.js ('k') | libadblockplus-android-webview/build.gradle » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 var hideElements = function() 1 var hideElements = function()
2 { 2 {
3
4 // no need to invoke if already invoked on another event 3 // no need to invoke if already invoked on another event
5 if (jsBridge.isElementsHidden()) 4 if ({{BRIDGE}}.isElementsHidden())
6 { 5 {
7 {{DEBUG}} console.log('already hidden, exiting'); 6 {{DEBUG}} console.log('already hidden, exiting');
8 return; 7 return;
9 } 8 }
10 9
11 // hide using element visibility (to be replaced with script body) 10 // hide using element visibility (to be replaced with script body)
12 {{HIDE}} 11 {{HIDE}}
13 12
14 {{BRIDGE}}.setElementsHidden(true); // set flag not to do it again 13 {{BRIDGE}}.setElementsHidden(true); // set flag not to do it again
15 }; 14 };
(...skipping 20 matching lines...) Expand all
36 }); 35 });
37 36
38 // DOMContentLoaded event 37 // DOMContentLoaded event
39 document.addEventListener('DOMContentLoaded', function() 38 document.addEventListener('DOMContentLoaded', function()
40 { 39 {
41 {{DEBUG}} console.log('DOMContentLoaded() event fired'); 40 {{DEBUG}} console.log('DOMContentLoaded() event fired');
42 hideElements(); 41 hideElements();
43 }, false); 42 }, false);
44 43
45 }; 44 };
LEFTRIGHT

Powered by Google App Engine
This is Rietveld