Created
November 16, 2018 08:29
-
-
Save aniquetahir/84a1dbe318b7d61fcf343b2d7c9df51d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function upvoteAll(){ | |
let all_elems = document.querySelectorAll('a.vote-up'); | |
let unvoted = []; | |
all_elems.forEach(e=>unvoted.push(e)); | |
unvoted = unvoted.filter(e=>e.className.indexOf('upvoted')==-1); | |
if(unvoted.length>0){ | |
unvoted[0].click(); | |
} | |
} | |
setInterval(upvoteAll, 1000); | |
function autoshow(){ | |
let alert = document.querySelectorAll('.alert--realtime'); | |
if(alert.length>0){ | |
setTimeout(()=>alert[0].click(),1000); | |
} | |
let buttons = document.querySelectorAll('.realtime-button.reveal'); | |
buttons.forEach(b=>{ | |
setTimeout(()=>b.click(),1000); | |
}); | |
} | |
setInterval(autoshow, 1000); | |
window.addEventListener( 'visibilitychange', evt => evt.stopImmediatePropagation(), true); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment