zoukankan      html  css  js  c++  java
  • 禁止选择或禁止复制网页数据

    禁止选择或禁止复制

        /** 屏蔽选中网页内容 */
    	document.onselectstart = function () { return false; }
    
    	/** 屏蔽复制网页内容 */
    	document.body.oncopy = function () { return false; }
    
    	/** 屏蔽剪切网页内容 */
    	document.body.oncut = function () { return false; }
    
    	/** 屏蔽向网页粘贴内容 */
    	document.body.onpaste = function () { return false; }
    
    	/** 屏蔽拷屏(不停的清空剪贴板) */
    	// window.setInterval('window.clipboardData("Text", "")', 100);
    
    	/**
    	 58. * 屏蔽查看源文件( <body onload=clear()> )
    	 59.*/
    	function clear() {
    		var source = document.body.firstChild.data;
    		document.open();
    		document.close();
    		document.body.innerHTML = source;
    	}
    

    破解友商网站禁止效果

    有些网站需要临时复制一下数据,只需要在控制台执行一下脚本

    document.onselectstart = function () { return true; } ;document.body.oncopy = function () { return true; }; document.body.oncut = function () { return true; };document.body.onpaste = function () { return true; }
    
  • 相关阅读:
    javascript设计模式(一)职责链模式China of responsibility
    javascript设计模式(一)策略模式Strategy
    angularjs提示消息弹出框
    Javascript设计模式(一)States
    Javascript设计模式(一)Facade
    NOIP2020
    RMQ & ST表
    NOI Linux
    初赛解析
    贪心大解析
  • 原文地址:https://www.cnblogs.com/frank-zhang/p/14609310.html
Copyright © 2011-2022 走看看