Skip to content

Instantly share code, notes, and snippets.

@perillamint
Created September 26, 2020 03:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save perillamint/d08130aacd77f074e8e3332c7fe510af to your computer and use it in GitHub Desktop.
Save perillamint/d08130aacd77f074e8e3332c7fe510af to your computer and use it in GitHub Desktop.
Huawei WebUI unlocker
// ==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