您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
turn every fuckin' Zhihu-style right quote into normal quote 让逼乎直角引号见乔布斯去吧!只要看见狗日的直角引号,点点按钮它们就能全部消失不见
当前为
// ==UserScript== // @name ZhihuZhuangbilityExterminator // @namespace nein // @author ddOs // @description turn every fuckin' Zhihu-style right quote into normal quote 让逼乎直角引号见乔布斯去吧!只要看见狗日的直角引号,点点按钮它们就能全部消失不见 // @include http://*.zhihu.com/* // @include https://*.zhihu.com/* // @version 1 // @grant GM_addStyle // ==/UserScript== // references: // https://greasyfork.org/en/scripts/25776-coincidence-detector for replacing method // https://stackoverflow.com/questions/6480082/add-a-javascript-button-using-greasemonkey-or-tampermonkey for button var zNode = document.createElement('div'); zNode.innerHTML = '<button id="myButton" type="button">'+ 'Fuck 果乎/逼乎/绿乎/whatever乎<br /> right in the pussy! </button>'; zNode.setAttribute('id', 'myContainer'); document.body.appendChild(zNode); //position = document.getElementByClass('CornerButtons') //position.appendChild(zNode); //--- Activate the newly added button. document.getElementById('myButton').addEventListener('click', ButtonClickAction, false ); function ButtonClickAction(zEvent) { (function () { function walk(node) { // I stole this function from here: // http://is.gd/mwZp7E var child, next; switch (node.nodeType) { case 1: case 9: case 11: child = node.firstChild; while (child) { next = child.nextSibling; walk(child); child = next; } break; case 3: handleText(node); break; } } function handleText(textNode) { textNode.nodeValue = textNode.nodeValue.replace('「', '“'); textNode.nodeValue = textNode.nodeValue.replace('」', '”'); textNode.nodeValue = textNode.nodeValue.replace('『', '‘'); textNode.nodeValue = textNode.nodeValue.replace('』', '’'); } walk(document.body); }) (); }//--- Style our newly added elements using CSS. GM_addStyle(multilineStr(function () { /*! #myContainer { position: fixed; top: 0; left: 0; font-size: 20px; background: orange; border: 3px outset black; margin: 5px; opacity: 0.9; z-index: 1100; padding: 5px 20px; } #myButton { cursor: pointer; } #myContainer p { color: red; background: white; } */ })); function multilineStr(dummyFunc) { var str = dummyFunc.toString(); str = str.replace(/^[^\/]+\/\*!?/, '') // Strip function () { /*! .replace(/\s*\*\/\s*\}\s*$/, '') // Strip */ } .replace(/\/\/.+$/gm, '') // Double-slash comments wreck CSS. Strip them. ; return str; }