Created
January 13, 2021 23:41
-
-
Save saitho/8b06e4b8e9eeda918d77097c17af9664 to your computer and use it in GitHub Desktop.
Tampermonkey - Reload Twitch stream on Error 2000
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 Twitch Reloader | |
// @namespace https://github.com/saitho | |
// @version 0.1 | |
// @description Reload twitch on 2000 error | |
// @author You | |
// @match https://www.twitch.tv/* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
function checkStatus() { | |
const results = document.querySelectorAll('.video-player p[data-test-selector="content-overlay-gate__text"]').length; | |
console.log(results); | |
if (results > 0) { | |
location.reload(); | |
} | |
} | |
window.onload = function () { | |
setInterval(checkStatus, 1000); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment