首页网文心情网络杂谈浏览器 网页禁止右键菜单代码、禁止复制粘贴代码

浏览器 网页禁止右键菜单代码、禁止复制粘贴代码

分类网络杂谈时间2021-05-10 13:31:32发布heikeyh浏览119
导读:浏览器 网页禁止右键菜单代码、禁止复制粘贴代码代码如下!!!!///////////////////////////////////////////////////////////////////////////////...



代码如下!!!!


///////////////////////////////////////////////////////////////////////////////

<script type="text/javascript">

//屏蔽右键菜单

document.oncontextmenu = function (event){

if(window.event){

event = window.event;

}try{

var the = event.srcElement;

if (!((the.tagName == "INPUT" && the.type.toLowerCase() == "text") || the.tagName == "TEXTAREA")){

return false;

}

return true;

}catch (e){

return false;

}

}

//屏蔽粘贴

document.onpaste = function (event){

if(window.event){

event = window.event;

}try{

var the = event.srcElement;

if (!((the.tagName == "INPUT" && the.type.toLowerCase() == "text") || the.tagName == "TEXTAREA")){

return false;

}

return true;

}catch (e){

return false;

}

}

//屏蔽复制

document.oncopy = function (event){

if(window.event){

event = window.event;

}try{

var the = event.srcElement;

if(!((the.tagName == "INPUT" && the.type.toLowerCase() == "text") || the.tagName == "TEXTAREA")){

return false;

}

return true;

}catch (e){

return false;

}

}

//屏蔽剪切

document.oncut = function (event){

if(window.event){

event = window.event;

}try{

var the = event.srcElement;

if(!((the.tagName == "INPUT" && the.type.toLowerCase() == "text") || the.tagName == "TEXTAREA")){

return false;

}

return true;

}catch (e){

return false;

}

}

//屏蔽选中

document.onselectstart = function (event){

if(window.event){

event = window.event;

}try{

var the = event.srcElement;

if (!((the.tagName == "INPUT" && the.type.toLowerCase() == "text") || the.tagName == "TEXTAREA")){

return false;

}

return true;

} catch (e) {

return false;

}

}

</script>

///////////////////////////////////////////////////////////////////////////////////////


Hackyh'Blog版权声明:以上内容作者已申请原创保护,未经允许不得转载,侵权必究!授权事宜、对本内容有异议或投诉,敬请联系网站管理员,我们将尽快回复您,谢谢合作!

网络技术
最新暗网网址 2021最新暗网入口 来自Telegram群组整理的收费分享 [JavaScript]检查当前用户是否按下F12,并自动跳转到指定地址.

游客 回复需填写必要信息
召唤伊斯特瓦尔