当前位置:网站首页>JS prevent the PC side from copying correct links

JS prevent the PC side from copying correct links

2022-06-23 00:44:00 Ziwei front end


        if (!/Mobi|Android|iPhone/i.test(navigator.userAgent)) {
            var json = {
                time: new Date().getTime()
            };
            var href = location.href;
            //  To be homologous 
            window.history.pushState(json, "", "http://oa.xxxxx.com/ Prohibit copying links ");
            window.onbeforeunload = function(e) {
                window.history.pushState(json, "", href)
            }
        }

原网站

版权声明
本文为[Ziwei front end]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/173/202206222049583550.html