ensure logged in script

This commit is contained in:
Bel LaPointe
2022-01-10 10:25:00 -05:00
parent f4c4e9cfbc
commit 7f770b1a00
2 changed files with 42 additions and 0 deletions

23
testdata/ensure_logged_in.js vendored Normal file
View File

@@ -0,0 +1,23 @@
// ==UserScript==
// @name NTGVision Logged In
// @namespace https://ntgvision.com/ *
// @description Ensure Login
// @include https://ntgvision.com/ *
// ==/UserScript==
// login on the login page
if (window.location.pathname == "/Account/Login") {
console.log("should login to login page")
setTimeout(() => {
var buttons = document.getElementsByTagName("button")
for(var i=0; i < buttons.length; i++) {
if (buttons[i].innerText.toLowerCase() == "login")
buttons[i].click()
}
}, 10000)
}
// refresh every hour
setTimeout(() => {
location.reload()
}, 1000 * 60 * 60)