Reddit blur NSFW 😅

Blur thumbnail images for NSFW-tagged posts on old.reddit.com

  1. // ==UserScript==
  2. // @name Reddit blur NSFW 😅
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.0
  5. // @description Blur thumbnail images for NSFW-tagged posts on old.reddit.com
  6. // @icon https://www.redditstatic.com/desktop2x/img/favicon/android-icon-192x192.png
  7. // @author Agreasyforkuser
  8. // @match https://old.reddit.com/*
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14. // Function to blur NSFW thumbnails
  15. function blurNSFWThumbnails() {
  16. const nsfwPosts = document.querySelectorAll('.nsfw-stamp');
  17. nsfwPosts.forEach(nsfwStamp => {
  18. const thumbnail = nsfwStamp.closest('.search-result, .link').querySelector('.thumbnail img');
  19. if (thumbnail) {
  20. thumbnail.style.filter = 'blur(5px)';
  21. }
  22. });
  23. }
  24. // Blur NSFW thumbnails on initial page load
  25. blurNSFWThumbnails();
  26. // Observe changes in the DOM and blur NSFW thumbnails dynamically
  27. const observer = new MutationObserver(() => blurNSFWThumbnails());
  28. const config = { childList: true, subtree: true };
  29. observer.observe(document.body, config);
  30. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址