您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Hide answers and comments on Puzzling.SE questions until you want to see them.
当前为
// ==UserScript== // @name Puzzling.SE Empuzzler // @namespace https://gf.qytechs.cn/users/5615-doppelgreener // @description Hide answers and comments on Puzzling.SE questions until you want to see them. // @grant none // @include http://puzzling.stackexchange.com/questions/* // @version 0.1 // ==/UserScript== // CSS styles needed var styles = []; styles.push("body:not(.show-comments) #question .comments { display: none; }"); styles.push("body:not(.show-comments) #question .comments-link { display: none; }"); styles.push("body:not(.show-comments) #question .bounty-link { display: none; }"); styles.push("body:not(.show-answers) #answers { display: none; }"); var main = function () { function makeButton(buttonText, classToAdd) { return $('<button>') .prop('type', 'button') .text(buttonText) .click(function() { $('body').addClass(classToAdd); $(this).remove(); }); } $(window).load(function() { var rev = $('<div>') .prop('id', 'empuzzler-revealers'); rev.append(makeButton("Show comments on question", 'show-comments')); rev.append(makeButton("Show answers", 'show-answers')); rev.insertAfter('#question'); }); }; // // Inject content into the page // // JavaScript var script = document.createElement('script'); script.type = 'text/javascript'; script.id = 'empuzzler-script' script.textContent = '(' + main.toString() + ')();'; document.body.appendChild(script); // CSS styles, borrowed from Stack Overflow Unofficial Patch: var styleElem = document.createElement('style'); styleElem.id = 'empuzzler-styles'; styleElem.type = 'text/css'; var code = ""; for (var id in styles) { code += styles[id] + "\n"; } styleElem.textContent = code.replace( /[}] */g, "}\n" ) var head = document.head || document.documentElement; head.appendChild(styleElem);
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址