🎀 🌸

使网站便捷的那些JS代码

有问题请联系小渡qq2092115940

使网站便捷的那些JS代码

限制网页只在手机端中打开,网站屏蔽PC端访问JS代码,网站只允许手机端访问

{hide}

<script type="text/javascript">
if(window.screen.width==0){window.location.replace("https://www.heylie.cn")};
var system={win:false,mac:false,xll:false};
var p = navigator.platform;
system.win=p.indexOf("Win")==0;
system.mac=p.indexOf("Mac")==0;
system.x11=(p=="X11") || (p.indexOf("Linux")==0);
if(system.win||system.mac||system.xll) {
location.replace("https://www.heylie.com");
}
</script>

{/hide}

屏蔽右键菜单

{hide}

<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;
   }
   }
</script>

{/hide}

屏蔽粘贴

{hide}

<script type="text/javascript">
   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;
   }
   }
   
</script>

{/hide}

屏蔽复制

{hide}

<script type="text/javascript">
   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;
   }
   }
   
</script>

{/hide}

屏蔽剪切

{hide}

<script type="text/javascript">
   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;
   }
   }
   
</script>

{/hide}

屏蔽选中

{hide}

<script type="text/javascript">
   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>

{/hide}

禁用右键(防止右键查看源代码)

{hide}

<script type="text/javascript">
           //禁用右键(防止右键查看源代码) 
       window.oncontextmenu=function(){return false;} 
       //禁止任何键盘敲击事件(防止F12和shift+ctrl+i调起开发者工具) 
       window.onkeydown = window.onkeyup = window.onkeypress = function () { 
           window.event.returnValue = false; 
           return false; 
       } 
       //如果用户在工具栏调起开发者工具,那么判断浏览器的可视高度和可视宽度是否有改变,如有改变则关闭本页面 
       var h = window.innerHeight,w=window.innerWidth; 
       window.onresize = function () { 
           if (h!= window.innerHeight||w!=window.innerWidth){ 
               window.close(); 
               window.location = "about:blank"; 
           } 
       }
</script>

{/hide}

温馨提示:本文最后更新于2024-08-08 22:23:00,某些文章具有时效性,若有错误或已失效,请在下方留言或联系站长
版权声明

   站内部分内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供网络资源分享服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请 联系我们 一经核实,立即删除。并对发布账号进行永久封禁处理。在为用户提供最好的产品同时,保证优秀的服务质量。


本站仅提供信息存储空间,不拥有所有权,不承担相关法律责任。
THE END
喜欢就支持一下吧
分享
评论 共1条

请登录后发表评论

    • 头像人机