Open
Description
As I found out Javascript statements like the following do not work in Firemonkey *.user.js scripts
Although they should work in Greasemonkey.
Can someone confirm this?
I anonymized the @match statement. matching works. Other statements are executed
How can I make them run in Firemonkey on Firefox on Windows?
// ==UserScript==
// @name Buttons remove (vanilla JS)
// @namespace http://your.namespace.here
// @version 1.0
// @description remove Buttons "Kursdaten" and "Chart verkleinern"
// @match ......*
// @grant none
// @run-at document-idle
// ==/UserScript==
(function () {
'use strict';
function removeButtons() {
const buttons = document.querySelectorAll('.button-area__button--left');
buttons.forEach(button => {
const text = button.textContent.trim();
if (text === 'Kursdaten' || text === 'Chart verkleinern') {
button.remove();
}
});
}
// Initial execute once
removeButtons();
// Monitor via MutationObserver
const observer = new MutationObserver((mutationsList, observer) => {
for (const mutation of mutationsList) {
if (mutation.type === 'childList') {
removeButtons();
}
}
});
observer.observe(document.body, {
childList: true,
subtree: true
});
})();