Skip to content

Instantly share code, notes, and snippets.

@saitho
Created January 13, 2021 23:41
Show Gist options
  • Save saitho/8b06e4b8e9eeda918d77097c17af9664 to your computer and use it in GitHub Desktop.
Save saitho/8b06e4b8e9eeda918d77097c17af9664 to your computer and use it in GitHub Desktop.
Tampermonkey - Reload Twitch stream on Error 2000
// ==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