From 9164d87f0f60539a0342fe9fdff632ead806348d Mon Sep 17 00:00:00 2001 From: David Lo Date: Tue, 4 Apr 2023 13:44:19 +0800 Subject: [PATCH] add remove portainer button script --- remove_portainer_upgrade_button.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 remove_portainer_upgrade_button.js diff --git a/remove_portainer_upgrade_button.js b/remove_portainer_upgrade_button.js new file mode 100644 index 0000000..0e74e25 --- /dev/null +++ b/remove_portainer_upgrade_button.js @@ -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); +})(); \ No newline at end of file