Code: Select all
const elements = document.querySelectorAll("*[style]");
elements.forEach((element) => {
const userSelect = element.style.userSelect;
const flex = element.style.flex;
//select by style because Objects have no id there and classes change everytime you reload for some reasons.
if (userSelect === "none" && flex === "1 1 0%") {
console.log(element.className + "was changed, the complete style was" +
element.style);
element.style.userSelect = "contain";
element.style.setProperty('user-select', 'contain');
console.log("new style is " + element.style.cssText);
//tried both out of desperation, log is unchanged
}
});
Ich habe sogar versucht, dies aus Verzweiflung auszulaufen < /p>
element.style.cssText = element.style.cssText.replace("user-select: none", "user-select: contain");
console.log("after the replace it is " + element.style.cssText);
< /code>
und das Attribut "Benutzerauswahl" verschwindet einfach aus dem Stil. Das F12 -Fenster kann ich richtig alles auswählen, was ich will. < /p>
Ich bin neu in diesem, aber völlig verloren. Es tut mir auch leid, dass ich so viel geschrieben habe.