>>2261121This doesn't work for .png images, first because your code only look at .jpg (obviously), but also because for .png, the small version of the file is stored as s.jpg not as s.png.
For whoever is reading, I just wanted to fix this anon's code below. Don't do it this way if you have 4chanX. 4chanX has a setting for this exact thing (if you don't use 4chanX for some reason, then use my code below). Press settings > image and video > tick replace PNG and JPG (webm and gif too if you want, the script below does all those extensions except .webm because it'd need some additional code). This does the exact same thing the script does, which is taking the original version of the image, and replacing the small version (thumbnail). Note that you will probably see some slowing down while scrolling because you are now showing a lot of full resolution images instead of having the small thumbnail version.
Below is the fixed script, put it into tempermonkey or some shit to automatically load up every time, but at this point why not use 4chanX? Or maybe you could use this with tempermonkey to only have it execute be on /w/? That would be the only use case that 4chanX wouldn't accomplish (using a script on specific boards).
let elements = document.getElementsByClassName("fileThumb");
Array.from(elements).forEach((element) => {
let img = element.querySelector("img"); // Selects the <img> tag inside the <a> tag
img.src = element.getAttribute("href");
});