js禁止开发者工具

$(document).keydown(function() {
    return key(arguments[0])
});
function key(e) {
    //f12
    var keynum;
    if (window.event) {
        keynum = e.keyCode;
    } else if (e.which) {
        keynum = e.which;
    }
    if (keynum == 123) {
        window.close();
        return false;
    }
    
    //ctrl+shift
    if (event.shiftKey&&event.ctrlKey) {
        window.close();
        return false;
    }
}

function Click() {
    window.event.returnValue = false;
}
document.oncontextmenu = Click;// 右击
View Code

 

转载于:https://www.cnblogs.com/yanan7890/p/8304883.html

你可能感兴趣的:(开发工具,javascript,前端)