Fix #5865 - fix channelnewsasia
[app.webkitpdf] / domains / channelnewsasia.com.js
1 (function (args) {
2     window.setInterval(function() {
3         try {
4             document.getElementsByClassName('endless-scroll-container')[0].style.display= 'none';
5         } catch(e) {}
6         var ar= document.getElementsByTagName('div');
7         for(var i=0;i<ar.length;i++) {
8             var  e = ar[i];
9             if ( e.style.zIndex > 10000) {
10                 e.style.display = "none";
11             }
12         }
13         ar= document.getElementsByTagName('aside');
14         for(var i=0;i<ar.length;i++) {
15             
16             ar[i].style.display = "none";
17             
18         }
19         
20     },500);
21     var  scrollTo = function(duration) {
22         var to  = document.body.scrollHeight;
23         if (duration <= 0) return;
24         var difference = to - document.body.scrollTop;
25         var perTick = difference / duration * 10;
26     
27         var sid = setInterval(function() {
28             document.body.scrollTop = document.body.scrollTop + perTick;
29             if (document.body.scrollTop > to) {
30                 clearInterval(sid );
31                 document.body.scrollTop = 0;
32             }
33             
34         }, 10);
35     }
36     scrollTo(1000);
37 })();