Greasy Fork镜像 支持简体中文。

屏蔽知乎私信提醒

try to take over the world!

目前為 2020-05-28 提交的版本,檢視 最新版本

// ==UserScript==
// @name         屏蔽知乎私信提醒
// @namespace    http://tampermonkey.net/
// @version      0.6
// @description  try to take over the world!
// @author       You
// @match        http://*.zhihu.com/*
// @match        https://*.zhihu.com/*
// @grant        none
// @run-at          document-end
// ==/UserScript==

(function () {
  var titleRegexp = /^\(.*\)/;
  var documentTitle = document.querySelector('head > title');
  var observer = new MutationObserver(function (mutations) {
    mutations.forEach(function (mutation) {
      console.log('new title:', mutation.target.textContent);
      if (titleRegexp.test(mutation.target.textContent)) {
        document.title = document.title.replace(titleRegexp, '');
        var targetRedDot = document.querySelector('.AppHeader-messages .css-ybodb');
        targetRedDot.parentNode.removeChild(targetRedDot);
      }
    });
  });
  observer.observe(documentTitle, {
    subtree: true,
    characterData: true,
    childList: true,
  });
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址