Last active
January 29, 2020 21:53
-
-
Save Zazcallabah/5c9a3a60363d8678c4d84ed9d32a7a03 to your computer and use it in GitHub Desktop.
stop twitch from autoplaying the next vod
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
// ==UserScript== | |
// @name Prevent Twitch autoplay | |
// @version 0.2 | |
// @match https://www.twitch.tv/* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
function _go(){ | |
var overlay = document.getElementsByClassName("player-overlay-background"); | |
if(overlay && overlay.length > 0) | |
{ | |
for(let item of overlay) | |
{ | |
var buttons = item.getElementsByTagName("button"); | |
if(buttons && buttons.length > 0) | |
{ | |
for(let button of buttons) | |
{ | |
if(button.innerText === "More Suggestions") | |
{ | |
button.click(); | |
} | |
} | |
} | |
} | |
} | |
var claim = document.getElementsByClassName("claimable-bonus__icon"); | |
if(claim && claim.length > 0) | |
{ | |
for(let item of claim) | |
{ | |
item.click(); | |
} | |
} | |
setTimeout(_go,5000); | |
} | |
_go(); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment