去除网页标题条数消息通知提醒

去除CSDN、知乎等网页标题消息通知提醒

// ==UserScript==
// @name           去除网页标题条数消息通知提醒
// @version        0.2
// @author         cooper1x
// @description    去除CSDN、知乎等网页标题消息通知提醒
// @match          *://blog.csdn.net/*
// @match          *://*.zhihu.com/*
// @run-at         document-end
// @namespace      https://greasyfork.org/zh-CN/scripts/452154
// ==/UserScript==
 
window.onload = () => {
  let timer = setInterval(removeMessageNotification, 300);
  function removeMessageNotification() {
    const regRule = {
      common: /^\(.*\)\s*/,
    }
    let currentTitle = document.title
    if (regRule.common.test(currentTitle)) {
      document.title = currentTitle.replace(regRule.common,"")
    }else{
      clearInterval(timer)
    }
  }
}