Chrome Extension Scroll Page

function scrolla(){
    chrome.tabs.executeScript({code: 'var x= document.body.scrollTop; document.body.scrollTop+=1; var y=document.body.scrollTop; if(x==y){document.body.scrollTop=0;}'});
}

chrome.browserAction.onClicked.addListener(function(tab) {

      var start = setInterval(function(){scrolla()},10);

    });

https://stackoverflow.com/questions/19472044/chrome-extension-scrolltop-0-enywhere

Advertisements