Created
July 30, 2019 13:45
-
-
Save Haraguroicha/2c528b3cd7873157b827c884f1e1a5e0 to your computer and use it in GitHub Desktop.
prevent fat finger shutdown the host
This file contains 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
(() => { | |
const targetNode = document.getElementById('content'); | |
const config = { attributes: false, childList: true, subtree: true }; | |
const callback = function(mutationsList, observer) { | |
for(let mutation of mutationsList) { | |
if (mutation.type === 'childList') { | |
(() => { | |
const a = document.querySelector('[id^="proxmoxButton"] span[data-ref="btnIconEl"].fa-power-off'); | |
if (!!a) { | |
const b = a.parentElement.parentElement.parentElement; | |
["x-btn-disabled", "x-unselectable", "x-item-disabled"].map(c => b.classList.add(c)); | |
} | |
})() | |
} | |
} | |
}; | |
const observer = new MutationObserver(callback); | |
observer.observe(targetNode, config); | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment