mirror of
https://gitlab.com/octospacc/Snippets.git
synced 2025-02-13 01:50:34 +01:00
Update TP-Link Hacks.user.js
This commit is contained in:
parent
e9b679e12e
commit
ff0f43f6fc
@ -19,16 +19,6 @@ var Ips = GM_getValue('IPs');
|
||||
var IsPageAllowed = (Ips.length == 0 || (Ips.length > 0 && Ips.includes(location.hostname)));
|
||||
|
||||
if (IsPageAllowed) {
|
||||
|
||||
//var Intvs = {};
|
||||
//var Cmd = new URLSearchParams(window.location.hash.toLowerCase()).get('hackcmd');
|
||||
//if (Cmd) {
|
||||
// localStorage.setItem('PrevCmd', Cmd);
|
||||
//} else {
|
||||
// Cmd = localStorage.getItem('PrevCmd');
|
||||
// localStorage.removeItem('PrevCmd');
|
||||
//};
|
||||
|
||||
// Note: localStorage is reset on new login and isn't reliable, we must use sessionStorage
|
||||
var Opts = new URLSearchParams(location.hash.toLowerCase()).get('tplinkhacks');
|
||||
if (Opts !== null) {
|
||||
@ -43,25 +33,13 @@ function qs(Query) {
|
||||
return document.querySelector(Query);
|
||||
};
|
||||
|
||||
//function IntvKey(Name) {
|
||||
// return `${Date.now()}-${Name}`;
|
||||
//};
|
||||
|
||||
function WaitTill(Cond, Fun) {
|
||||
/*Intvs[Key]*/
|
||||
var Intv = setInterval(function(){
|
||||
if (Cond()) {
|
||||
//console.log(Key);
|
||||
clearInterval(Intv/*Intvs[Key]*/);
|
||||
clearInterval(Intv);
|
||||
Fun();
|
||||
};
|
||||
}, 100);
|
||||
//function Call() {
|
||||
// if (Cond) Fun();
|
||||
// else { Rept(); console.log(0); }
|
||||
//};
|
||||
//function Rept() { setTimeout(Call, 50); };
|
||||
//Rept();
|
||||
};
|
||||
|
||||
function WaitElClick(Query, Fun) {
|
||||
@ -81,19 +59,10 @@ function AfterCmd() {
|
||||
};
|
||||
|
||||
function ReLogin() {
|
||||
// Attempt to logout if needed
|
||||
//qs('#logout-button a').click();
|
||||
//qs('#global-confirm #global-confirm-btn-ok a').click();
|
||||
|
||||
// Attempt to login if needed
|
||||
//try {
|
||||
WaitTill(function(){ return qs('#local-login-pwd input'); }, function(){
|
||||
qs('#local-login-pwd input').value = GM_getValue('Password');
|
||||
WaitElClick('#local-login-button a');
|
||||
});
|
||||
//qs('#local-login-pwd input').value = GM_getValue('Password', 'admin');
|
||||
//qs('#local-login-button a').click();
|
||||
//} catch(Ex) {};
|
||||
};
|
||||
|
||||
function Reboot() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user