Reddit Age Bypass

Bypass the "open in app prompt" for nsfw posts

  1. // ==UserScript==
  2. // @name Reddit Age Bypass
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.02
  5. // @description Bypass the "open in app prompt" for nsfw posts
  6. // @author Bababoiiiii
  7. // @license MIT
  8. // @match https://www.reddit.com/*
  9. // @icon https://www.google.com/s2/favicons?sz=64&domain=reddit.com
  10. // ==/UserScript==
  11.  
  12. // Use in Combination with this ublock filter (block this url: www.redditstatic.com/shreddit/*xpromo-nsfw-blocking-modal-*.js)
  13. // www.redditstatic.com/shreddit*xpromo-nsfw-blocking-modal-*.js$script,domain=www.reddit.com
  14. // This Ublock filter can be used as a replacement for this script, i dont know if it has any other impact though
  15. // www.reddit.com##div.prompt
  16.  
  17. function log(text) {
  18. console.log("[Reddit Age Bypass] " + text);
  19. }
  20.  
  21. (function() {
  22. "use strict";
  23.  
  24. function wait_and_remove() {
  25. clearInterval(wait_for_post);
  26. wait_for_post = setInterval(() => {
  27. log("Waiting for post");
  28.  
  29. const icon = document.querySelector("span.flex.gap-xs.items-center.pr-xs.truncate > span > faceplate-tracker > a > div");
  30. if (icon !== null) {
  31. clearInterval(wait_for_post);
  32. log("Post found");
  33.  
  34. // check if the icon is nsfw -> post is nsfw
  35. if (icon.querySelector("icon-nsfw") !== null) {
  36. const blurs = document.querySelectorAll("xpromo-nsfw-blocking-container");
  37. log(`Post is NSFW, removing ${blurs.length} blurs`);
  38. blurs.forEach(blur_elem => blur_elem.shadowRoot.querySelector("div.prompt").remove());
  39. log("Bypass successfull");
  40. }
  41. }
  42. }, 500);
  43. }
  44.  
  45. let wait_for_post;
  46. wait_and_remove();
  47.  
  48. const wait_for_polyfill = setInterval( () => {
  49. if (window.navigation) {
  50. clearInterval(wait_for_polyfill);
  51. window.navigation.addEventListener("navigate", () => wait_and_remove());
  52. }
  53. }, 10)
  54.  
  55. })();

QingJ © 2025

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