来自 这里
把它放到油猴插件中,每当网站地址匹配 @include对应的模式,油猴脚本即生效.
下面是个移除csdn复制时的小尾巴 ,以及删除"分享海报说明"的油猴脚本(非原创,在此感谢原作者)
// ==UserScript==
// @name csdn移除复制小尾巴
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @include *blog.csdn.net/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
// Your code here...
[...document.querySelectorAll('*')].forEach(item=>{
item.oncopy = function(e) {
e.stopPropagation();
}
});
//删分享海报
var child=document.getElementById("shareSuggest");
child.parentNode.removeChild(child);
})();