add remove portainer button script

This commit is contained in:
David Lo committed 2023-04-04 13:44:19 +08:00
1 parent 2864252334
commit 9164d87f0f
1 file changed
+27
+27
View File
@@ -0,0 +1,27 @@
// ==UserScript==
// @name Remove Portainer "Upgrade to Business Edition" Button
// @namespace http://tampermonkey.net/
// @version 1.0
// @description Remove Portainer "Upgrade to Business Edition" Button
// @author David Lo
// @match *
// @grant none
// @run-at document-end
// ==/UserScript==
(function() {
'use strict';
const existCondition = setInterval(function() {
const buttonTags = document.getElementsByTagName("button");
const searchText = "Upgrade to Business Edition";
let found;
for (let i = 0; i < buttonTags.length; i++) {
if (buttonTags[i].textContent == searchText) {
found = buttonTags[i];
found.remove()
clearInterval(existCondition);
break;
}
}
}, 500);
})();