Skip to content

Instantly share code, notes, and snippets.

@Zazcallabah
Last active January 29, 2020 21:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Zazcallabah/5c9a3a60363d8678c4d84ed9d32a7a03 to your computer and use it in GitHub Desktop.
Save Zazcallabah/5c9a3a60363d8678c4d84ed9d32a7a03 to your computer and use it in GitHub Desktop.
stop twitch from autoplaying the next vod
// ==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