Reddit Mobile Annoyance blocker

Bypass "Open in app" prompts, unblur NSFW

当前为 2025-04-01 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Reddit Mobile Annoyance blocker
  3. // @namespace Violentmonkey Scripts
  4. // @match https://www.reddit.com/*
  5. // @match https://sh.reddit.com/*
  6. // @grant none
  7. // @version 1.0
  8. // @author AfZ
  9. // @description Bypass "Open in app" prompts, unblur NSFW
  10. // @license MIT
  11. // ==/UserScript==
  12.  
  13. const callback = () => {
  14. document.querySelector("#xpromo-bottom-sheet").remove(); // Remove "Open in app prompt"
  15. document.querySelector("#blocking-modal").remove(); // Remove "Mature Content" modal
  16. document.querySelector("div[style='position: fixed; inset: 0px; backdrop-filter: blur(4px);']").remove(); // Unblur
  17. document.getElementsByTagName("xpromo-nsfw-blocking-container")[0].shadowRoot.querySelector(".prompt").remove(); // Remove "Mature Content" message in description
  18. }
  19.  
  20. const observer = new MutationObserver(callback);
  21. observer.observe(document, {
  22. childList: true,
  23. subtree: true,
  24. attributes: true,
  25. });
  26.  
  27. setTimeout(() => {
  28. const isShreddit = document.querySelector("shreddit-app");
  29. // Check if Shreddit
  30. if (!isShreddit) observer.disconnect();
  31. }, 8000);