Greasy Fork is available in English.
Remove the on-screen modal that forces you to log in for certain posts.
当前为
// ==UserScript==
// @name Remove Reddit Login Requirement
// @namespace socuul.reddit_rem_loginreq
// @version 1.0.1
// @description Remove the on-screen modal that forces you to log in for certain posts.
// @author SoCuul
// @license MIT
// @match http://*.reddit.com/*
// @match https://*.reddit.com/*
// @icon https://reddit.com/favicon.ico
// @grant none
// ==/UserScript==
// Prevents script to load twice as Reddit uses iframes
if (window.top != window.self) { return false; }
(function() {
const nsfwBlockingModal = document.querySelector('[bundlename=desktop_rpl_nsfw_blocking_modal]')
nsfwBlockingModal?.remove()
const nsfwBlurredContainer = document.querySelector('shreddit-blurred-container')?.shadowRoot?.firstElementChild
nsfwBlurredContainer?.setAttribute('class', nsfwBlurredContainer.attributes?.getNamedItem('class')?.nodeValue?.replace(/xs:rounded-t-\[16px\] xs:rounded-b-\[16px\]/g, ''))
const mainContent = document.querySelector('.sidebar-grid')
mainContent?.setAttribute('style', mainContent.attributes?.getNamedItem('style')?.nodeValue?.replace(/filter: blur\(4px\);/g, ''))
const body = document.querySelector('body')
body?.setAttribute('style', body.attributes?.getNamedItem('style')?.nodeValue?.replace(/pointer-events: none; overflow: hidden;/g, ''))
//Remove other elements
const observerOptions = { subtree: true, childList: true }
const mObserver = new MutationObserver(function() {
const nsfwBlockingContainer = document.querySelector('xpromo-nsfw-blocking-container')?.shadowRoot?.querySelector('.prompt')
nsfwBlockingContainer?.remove()
})
mObserver.observe(document, observerOptions)
})();