網頁防扒技術合集

1.禁用瀏覽器右鍵菜單

document.oncontextmenu = new Function("return false;");

2.監聽鍵盤事件

document.onkeydown = document.onkeyup = document.onkeypress = function(event) {    var e = event || window.event || arguments.callee.caller.arguments[0];    if (e && e.keyCode == 123) {            window.location = 'about: blank';            e.returnValue = false;            return (false);    }}

3.檢測控制臺

function mAlert() {    var fn = function () {};    fn.toString = function () {        window.location = 'about: blank';        console.log("呵呵");    }    console.log("%c", fn);//請不要刪除這行};mAlert();

4.鼠標點擊事件

document.onmousedown = function mdClick(event) {    var e = event || window.event || arguments.callee.caller.arguments[0];    if (e.button == 2 || e.button == 3) {        alert("呵呵");        //不建議用以下方法,易錯率大        window.location = 'about: blank';    }}

5.禁止保存

 document.onkeydown = function() {        if ((e.ctrlKey) && (e.keyCode == 83)) { //ctrl+s            alert("ctrl+s被禁用");            return false;        }    }

6.css禁止左鍵右鍵

//左鍵〈body onselectstart="return false"〉//右鍵〈body οncοntextmenu='return false'〉
------本頁內容已結束,喜歡請分享------
溫馨提示:由于項目或工具都有失效性,如遇到不能做的項目或不能使用的工具,可以根據關鍵詞在站點搜索相關內容,查看最近更新的或者在網頁底部給我們留言反饋。
? 版權聲明
THE END
喜歡就支持一下吧
點贊4513 分享
評論 搶沙發

請登錄后發表評論

    暫無評論內容