您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Redirects NSFW subreddits to another site.
// ==UserScript== // @name Reddit - Block NSFW // @description Redirects NSFW subreddits to another site. // @version 1.2 // @include /^https?://.*\.reddit\.com/r/.*$/ // @license GPLv3 // @grant GM_xmlhttpRequest // @namespace https://greasyfork.org/users/10480 // ==/UserScript== var redirectUrl = "https://www.reddit.com"; // Set this to url you want to redirect to. var url = document.URL; if (url.substring(url.length-1) != "/") { url = url + "/"; } var jsonUrl = url + "about.json"; GM_xmlhttpRequest ({ method: "GET", url: jsonUrl, onload: function(response) { var json = JSON.parse(response.responseText); if (json.data.over18 || json[0].data.children[0].data.over_18) { window.location.replace(redirectUrl); } } });