去掉知乎/CSDN网页标题未读消息提示

浏览器下载油猴/暴力猴插件,新建脚本粘入下面的代码:

// ==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];
    }
})();

参考并感谢:

  1. 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
  2. https://www.bilibili.com/video/BV1Ng411E7DA?spm_id_from=333.999.0.0
  3. 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
  • 8
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值