I am browsing a forum as a guest which has embedded pictures. By default, the website blurs the pictures for non-logged in users.
Looking at the HTML I have found that I can change the following span’s class to be empty:
<span class="attachmentPreview">
to
<span class="">
in order to lift the pictures blur.
I have very basic knowledge of JavaScript, but enough to load my first extensions into Firefox and ensure that it only runs on a specific URL (the forum in this case).
My questions:
-
How do I interact with the specific element (span class="attachmentPreview"?) in order to modify it to update to ?
-
It needs to happen on the go, as the forum dynamically blurs the picture as the user scrolls down between the posts: How do I ensure my script continuously checks for any new pictures on the website?
Many thanks
I am able to find the elements with document.getElementsByClassName("attachmentPreview")
2
Answers
Just inject a style sheet that overrides the rule or add an extension that allows you to add custom styles to a site.
Here is an example using
MutationObserver
: