如何关闭CSDN博客的系统通知
一、油猴脚本 方式
// ==UserScript==
// @name 关闭csdn通知
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://blog.csdn.net/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
setTimeout(function () {
//1.删除消息按钮
var msg=document.getElementsByClassName("toolbar-btn toolbar-btn-msg csdn-toolbar-fl")[0];
msg.className="toolbar-btn csdn-toolbar-fl";
//2.删除标题中的(x条消息)
var tt=document.title;
document.title = tt.replace(/^\([^()]*条消息\)/,"");
},300);
})();
二、 AdBlock方式
AdBlock 右键 -》选项 -》手动编辑拦截规则
编辑 添加如下规则
(只能去除消息按钮,不能去除title上的 *条消息)
blog.csdn.net##A[class="toolbar-advert-default "]
blog.csdn.net##DIV[class="toolbar-advert"]
blog.csdn.net##SPAN[class="pos-rel"]