I am pretty sure that, for obvious security reasons, you cannot alter a web page at its source, however, they exists extensions that alter the page on reception (most of them are not useful at all, like adwares, but others can prove useful, I think an extension exists that convert gifs to videos, which are lighter to download.)
I did not really understand the point of this topic though. So I may just be completely off topic.