当前位置:网站首页 > 更多 > 涨姿势 > 正文

[每日一学] 解除切屏和复制限制

作者:CC下载站 日期:2021-10-18 00:00:00 浏览:68 分类:涨姿势

//解除切屏限制
window.onmouseleave = window.onblur = window.onmouseout = document.onmouseleave = document.onblur = document.onmouseout = document.body.onmouseleave = document.body.onblur = document.body.onmouseout = onmouseleave = onblur = onmouseout = null;

//解除选中文本限制(这里html看具体考试页面绑定的限制事件dom而定)
window.onselectstart = document.onselectstart = document.body.onselectstart = onselectstart = document.querySelector("html").onselectstart = null;

//解除复制粘贴限制
window.oncopy = window.onpaste = document.oncopy = document.onpaste = document.body.oncopy = document.body.onpaste = oncopy = onpaste = null;

//解除右键菜单限制(这里html看具体考试页面绑定的限制事件dom而定)
window.oncontextmenu = document.oncontextmenu = document.body.oncontextmenu = oncontextmenu = document.querySelector("html").oncontextmenu = null;

//解除快捷键操作屏蔽
window.onkeyup = window.onkeydown = window.onKeyPress = document.onkeyup = document.onkeydown = document.onKeyPress = document.body.onkeyup = document.body.onkeydown = document.body.onKeyPress = onkeyup = onkeydown = onKeyPress = null;

您需要 登录账户 后才能发表评论

取消回复欢迎 发表评论:

关灯