But is there a broader command also blocking things like:
Sliders
Moving text (loop-moving-text).
gif files or any other animation files.
I think I am looking for a “freeze almost anything” command but one which would still allow me to select text (to copy-paste it), scrolling, clicking links, etc.
Note: I’m not saying its not possible to make things not do what they are currently doing. What i’m saying is your scope for what you’re asking for is so unbelievably broad that there’s not going to be an answer. If your question is “how do i stop this specific animation from playing on this specific website”, someone can offer a suggestion. But it will work for that situation, not all of them.
will work… IF the slider is a standard input range with an ID mySlider, and nowhere else. You CAN target all input range elements: querySelectorAll("input[type='range']") will target all such elements, and you can walk through them and remove them.
But that wont stop other kinds… shrug
Ignoring the messy JavaScript+CSS combo syntax, this removed gif files from a particular webpage, but when I have changed 'img[src*=".gif"]' to one of the following:
'img[src*=".png"]'
'img[src*=".jpg"]'
'img[src*=".bmp"]'
'img[src*=".webp"]'
Then, nothing was removed.
Apparently, this is gif selective but I am not sure if in 100% of the cases.
If I recall correctly, a filename (and hence its file type) can be hidden somehow, by loading it asychronously from a Binary Large Object (BLOb) perhaps?
If it is not being removed then there is something wrong with the selector.
Console.log the element and the element’s parent.
If the parent is null it will do nothing and if the element is not an element it will not be removed
If the variable you have selected is not an html element then it will not be removed.
Elements are nodes but not all nodes are elements.
Because the element.remove() method only works on variables which are elements.