0
点赞
收藏
分享

微信扫一扫

网站复制内容自动增加版权信息

宁静的猫 2022-01-16 阅读 66

JS代码如下:

<script>
function addLink() {
    var selection = window.getSelection();
    pagelink = "【迟博勋博客】原文链接: " + document.location.href;
    copytext = selection + pagelink;
    newp = document.createElement('p');
    newp.style.position = 'absolute';
    newp.style.left = '-99999px';
    document.body.appendChild(newp);
    newp.innerHTML = copytext;
    selection.selectAllChildren(newp);
    window.setTimeout(function () {
        document.body.removeChild(newp);
    }, 100);
}
document.oncopy = addLink;
</script>

将品牌词修改为自己的就可以了。

更多相关内容请访问迟博勋博客查看。

举报

相关推荐

0 条评论