JavaScript在复制粘贴网页内容时自动添加出处

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

<script type="text/javascript">
document.body.oncopy = function () {
setTimeout( function () { 
    var text = clipboardData.getData("text"); 
    if (text) { 
        text = text + "\r\n\r\n原文地址:"+location.href; 
        clipboardData.setData("text", text); 
    } 
}, 100 );
};
</script>