Skip to content

Instantly share code, notes, and snippets.

@Haraguroicha
Created July 30, 2019 13:45
Show Gist options
  • Save Haraguroicha/2c528b3cd7873157b827c884f1e1a5e0 to your computer and use it in GitHub Desktop.
Save Haraguroicha/2c528b3cd7873157b827c884f1e1a5e0 to your computer and use it in GitHub Desktop.
prevent fat finger shutdown the host
(() => {
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