Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var interv = 120000; // ms
- window._intervalId = undefined;
- function startAutoRefresh(){
- window._intervalId = setInterval(function(){
- if (!document.getElementsByClassName('scan active')[0]) {
- document.getElementsByClassName('scan')[0].click();
- console.log('auto scan start');
- }
- else{
- console.log('auto scan skipped, already running');
- }
- }, interv)
- }
- function stopAutoRefresh(){
- if (window._intervalId){
- clearInterval(window._intervalId);
- window._intervalId = undefined;
- }
- else{
- console.error('stop called without start');
- }
- }
- startAutoRefresh();
Add Comment
Please, Sign In to add comment