zoukankan      html  css  js  c++  java
  • xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!

    js & disabled right click

    
    (() => {
      const log = console.log;
      log(`disabled copy`);
    
      document.body.oncontextmenu = 
      document.body.ondragstart = 
      document.body.onselectstart = 
      document.body.onbeforecopy = function() {
        return false;
      };
    
      document.body.onselect = 
      document.body.oncopy = 
      document.body.onmouseup = function() {
        document.selection.empty();
      };
    })();
    
    
    
            <script type="text/javascript">
                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) {
                    document.writeln("");
                } else {
                    document.writeln("<script type="text/javascript" language="javascript" src="/js/waptbplay3.js"></script>");
                }
            </script>
            <script type="text/javascript">
                document.body.oncontextmenu = document.body.ondragstart = document.body.onselectstart = document.body.onbeforecopy = function() {
                    return false;
                }
                ;
                document.body.onselect = document.body.oncopy = document.body.onmouseup = function() {
                    document.selection.empty();
                }
                ;
            </script>
    
    
    
      document.body.oncontextmenu = 
      document.body.ondragstart = 
      document.body.onselectstart = 
      document.body.onbeforecopy = function() {
        return false;
      };
    
      document.body.onselect = 
      document.body.oncopy = 
      document.body.onmouseup = function() {
        document.selection.empty();
      };
    
    
    
    
    window.addEventListener('DOMContentLoaded', (event) => {
      console.log('DOM fully loaded and parsed');
    
      document.body.oncontextmenu = 
      document.body.ondragstart = 
      document.body.onselectstart = 
      document.body.onbeforecopy = function() {
        return false;
      };
    
      document.body.onselect = 
      document.body.oncopy = 
      document.body.onmouseup = function() {
        document.selection.empty();
      };
    });
    
    

    demo

    一条狗的使命2


  • 相关阅读:
    MVC 使用Response.Redirect页面301重定向
    火狐浏览器缓存登录名、密码解决方法
    访问网站不存在的页面的时候跳转到指定页面,不需要报文件不存在
    2 分钟读懂大数据框架 Hadoop 和 Spark 的异同
    toString("#.##")
    状态保存机制之ViewState概述及应用
    数据库分页
    【模拟】 【HDU 5831】 Rikka with Parenthesis II
    【贪心】 【HDU 5821】 Ball
    【set】【HDU 5818】 Joint Stacks
  • 原文地址:https://www.cnblogs.com/xgqfrms/p/12275284.html
Copyright © 2011-2022 走看看