0
点赞
收藏
分享

微信扫一扫

js防止PC端复制正确的链接

if (!/Mobi|Android|iPhone/i.test(navigator.userAgent)) {
var json = {
time: new Date().getTime()
};
var href = location.href;
// 要同源
window.history.pushState(json, "", "http://oa.xxxxx.com/禁止复制链接");
window.onbeforeunload = function(e) {
window.history.pushState(json, "", href)
}
}


举报

相关推荐

0 条评论