Greasy Fork

Greasy Fork is available in English.

ZhihuZhuangbilityExterminator

turn every fuckin' Zhihu-style right quote into normal quote 让逼乎直角引号见乔布斯去吧!只要看见狗日的直角引号,点点按钮它们就能全部消失不见

当前为 2017-08-25 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==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: 
// http://greasyfork.icu/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;
}