Replace Images with Animated Smiley

Replaces all images (including JPG, PNG, GIF, etc.) on the page with an animated smiley.

  1. // ==UserScript==
  2. // @name Replace Images with Animated Smiley
  3. // @namespace your-namespace
  4. // @version 1.0
  5. // @description Replaces all images (including JPG, PNG, GIF, etc.) on the page with an animated smiley.
  6. // @author Your Name
  7. // @match https://zelenka.guru/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13.  
  14. var smileyImageUrl = 'https://lztcdn.com/files/310336b3-c10e-4ad1-8fdf-0bbe73835ca1.webp';
  15.  
  16. function replaceImagesWithSmiley() {
  17. var images = document.querySelectorAll('img, span.img.m');
  18.  
  19. for (var i = 0; i < images.length; i++) {
  20. if (images[i].tagName === 'IMG') {
  21. images[i].src = smileyImageUrl;
  22. } else if (images[i].style.backgroundImage) {
  23. images[i].style.backgroundImage = 'url(' + smileyImageUrl + ')';
  24. }
  25. }
  26. }
  27.  
  28. replaceImagesWithSmiley(); // Replace images initially
  29.  
  30. // Set an interval to check and replace images every second
  31. setInterval(replaceImagesWithSmiley, 1000);
  32. })();