Skip to content

Instantly share code, notes, and snippets.

@ParkNoBreak
Last active October 22, 2018 13:42
Show Gist options
  • Save ParkNoBreak/9501dbeec4d88575657ee44f1e4b34bf to your computer and use it in GitHub Desktop.
Save ParkNoBreak/9501dbeec4d88575657ee44f1e4b34bf to your computer and use it in GitHub Desktop.
off
// ==UserScript==
// @name BitTube No Offline
// @namespace http://tampermonkey.net/
// @version 1
// @description BitTube Never Stop Ever Again
// @author ReaperBot
// @match *.bit.tube/*
// @grant none
// ==/UserScript==
(function () {
'use strict';
var page
var offline
var selected
var bittube
setInterval(mySearch, 5000);
function mySearch() {
page = document.body.textContent.toLowerCase() || document.body.innerText.toLowerCase();
offline = page.indexOf("offline") !== -1;
selected = page.indexOf("selected") !== -1;
bittube = page.indexOf("bittube") == -1;
if (offline || selected || bittube) {
setTimeout(function () {
window.location.reload(true);
}, 5000);
}
}
function getRndInteger(min, max) {
return (Math.floor(Math.random() * (max - min)) + min) * 1000;
}
setInterval(reloadOk, getRndInteger(2000, 3600));
function reloadOk() {
window.location.reload(true);
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment