// ==UserScript== // @name cdsn标题优化 // @namespace http://tampermonkey.net/ // @version 0.1 // @description 优化csdn网页标题,便于保存 // @author You // @match *://*.csdn.net/* // @match https://blog.csdn.net/* // @icon https://g.csdnimg.cn/static/logo/favicon32.ico // @grant none // @license MIT // @downloadURL none // ==/UserScript== (function() { 'use strict'; // Your code here... window.onload = function(){ var patt = /(\d条消息)/; var title = document.getElementsByTagName('title')[0].innerText if(title!=null && patt.test(title)){ document.getElementsByTagName('title')[0].innerText = title.replace(patt,"") } //if(title!=null && title.startsWith('(2条消息) ')){ // document.getElementsByTagName('title')[0].innerText = title.replace('(2条消息) ','') //} var solist = document.getElementsByClassName('hl-1'); if(solist.length>0){ for(var s in solist){ //console.info(solist[s].outerHTML); solist[s].href = ""; //console.info(solist[s].attributes) solist[s].attributes[3] = ''; solist[s].attributes[4] = ''; solist[s].attributes[5] = ''; solist[s].attributes[6] = ''; } } } })();