浏览器下载油猴/暴力猴插件,新建脚本粘入下面的代码:
// ==UserScript==
// @name 去掉知乎/CSDN网页标题未读消息提示
// @namespace Violentmonkey Scripts
// @home-url https://greasyfork.org/zh-CN/scripts/435087
// @match https://*.zhihu.com/*
// @match https://*.csdn.net/*
// @grant none
// @version 2.4
// @author -
// @description 去掉那些该死的消息提示!
// @icon https://tikolu.net/i/hfgls
// @license GNU GPLv3
// ==/UserScript==
// title = document.getElementsByTagName("title")[0];
// setInterval(function(){ //定时循环执行
// title.innerText = title.innerText.match(/(\([0-9]+.*(?=私信|消息).*?\)\s*)?(.+)/)[2];
// },100);//定时100ms
(function() {
'use strict';
window.onload = function() {
let title = document.getElementsByTagName("title")[0];
title.innerText = title.innerText.match(/(\([0-9]+.*(?=私信|消息).*?\)\s*)?(.+)/)[2];
}
})();
参考并感谢:
- https://greasyfork.org/zh-CN/scripts/435087-%E5%8E%BB%E6%8E%89%E7%9F%A5%E4%B9%8E-csdn%E7%BD%91%E9%A1%B5%E6%A0%87%E9%A2%98%E6%9C%AA%E8%AF%BB%E6%B6%88%E6%81%AF%E6%8F%90%E7%A4%BA
- https://www.bilibili.com/video/BV1Ng411E7DA?spm_id_from=333.999.0.0
- https://greasyfork.org/zh-CN/scripts/430145-%E7%A6%81%E6%9C%AF-%E9%99%8D%E9%B8%A1-%E7%BB%99%E8%94%A1%E5%BE%90%E5%9D%A4%E9%99%8D%E7%BA%A7%E5%A4%84%E7%BD%9A