Created
September 26, 2020 03:14
-
-
Save perillamint/d08130aacd77f074e8e3332c7fe510af to your computer and use it in GitHub Desktop.
Huawei WebUI unlocker
This file contains hidden or 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 Huawei Hidden settings | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Huawei WebUI unlocker | |
// @author perillamint | |
// @match http://192.168.8.1/* | |
// @grant none | |
// @license GPL-3.0 | |
// ==/UserScript== | |
const walkTheDOM = (node, func) => { | |
func(node); | |
node = node.firstChild; | |
while (node) { | |
walkTheDOM(node, func); | |
node = node.nextSibling; | |
} | |
} | |
const searchClassList = (elem, target) => { | |
for (let i = 0; i < elem.length; i++) { | |
if (elem[i] == target) { | |
return i; | |
} | |
} | |
return -1; | |
} | |
const unlock = () => { | |
walkTheDOM(document.body, (node) => { | |
if (node.style && node.style.display == 'none') { | |
node.style.display = '' | |
} | |
//if (node.classList && searchClassList(node.classList, 'hide') != -1) { | |
// node.classList.remove('hide'); | |
//} | |
}); | |
}; | |
const observer = new MutationObserver((mutations) => { | |
unlock(); | |
}); | |
observer.observe(document, {subtree: true, childList: true}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment