Sleazy Fork is available in English.

Remove Spoiler and Hidden Classes

Remove spoiler and hidden classes from elements

  1. // ==UserScript==
  2. // @name Remove Spoiler and Hidden Classes
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.2
  5. // @description Remove spoiler and hidden classes from elements
  6. // @author bighype
  7. // @include /^https:\/\/www\.empornium\.(me|sx|is)\/torrents\.php\?id=\d+/
  8. // @license MIT
  9.  
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15.  
  16. // Select the elements with the "spoiler" and "hidden" classes
  17. var elements = document.querySelectorAll('blockquote.spoiler.hidden');
  18.  
  19. // Loop through the elements and remove the classes
  20. elements.forEach(function(element) {
  21. element.classList.remove('spoiler', 'hidden');
  22.  
  23. // Show images within the blockquote and replace data-src with src
  24. var images = element.querySelectorAll('img.bbcode.scale_image');
  25. images.forEach(function(img) {
  26. img.style.display = 'inline-block';
  27. img.style.visibility = 'visible';
  28. var dataSrc = img.getAttribute('data-src');
  29. if (dataSrc) {
  30. img.setAttribute('src', dataSrc);
  31. img.removeAttribute('data-src');
  32. }
  33. });
  34. });
  35. })();