Kann man JS nach Farbe testen?
Kann man ein Skript im eigenen Browser laufen lassen, dass z.B. alle blauen Schaltflächen auf einer Website versteckt?
Kann man ein Skript machen, dass immer wenn in einem Block eine blaue Schaltfläche auftaucht, der ganze Block ausgeblendet wird?
Also das würde nur das Aussehen der eigenen Seite verändern, nichts am Server, sondern nur welchen Teil einer Website man sieht! So könnte man z.B. immer den Sportteil einer News Seite automatisch ausblenden oder so.
Yes, that can be implemented with JavaScript. Basically, only the color space is split and then the desired changes are made using the values.
In the next step, keep writing more functions, what exactly should happen. Be it edit, remove, and what else you want to do with it.
You can also create or query other color spaces in which you can not only see/filter the colors used by RGB. It ultimately depends on yourself how far you expand and apply your script with features.
Can you hide the Parent Element as a result? And if so, how?
This is also possible and JavaScript already brings everything necessary. For this with the DOM methods/properties closest and/or parentelement can work.
Your function could look like this:
With the universal selector (*), hold each higher-level element and then indicate that it is to be removed. In the if conditions, include your function to check the color and negotiate everything else.
could make n Cronjob drauß to automate this
Thank you.
Oh, almost forgotten. If you’re using Tempermonkey, you’ll have to insert jQuery beforehand. You might have to look again, as I have done nothing with this extension myself.
Thank you.
It doesn’t change much:
It will QuerySelectorAll by $(”)and window.getComputedStyle(element) by $(element).css(‘background-color’) replaced. Everything else remains unchanged.
At the end, the actual function call has to come. Say the instruction to run the browser, these or those functions.
Nevertheless, you would be advised to read the basics of JavaScript. Otherwise ask questions about questions and do not really understand. Alternatively, use ChatGPT to help you explain something more.
LG medmonk
Is this about Jquery? Because I can only Jquery :/ or only go with Javascript. I ask because I would like to understand the code and Javascript is too high. Thank you in any case, if you have the nerve to translate it in Jquery, I would be twice grateful to you:) How to use the JS in the Tampermonkey Framework or how that was called a plugin in Firefox? LG