网页屏蔽f12、右键菜单等操作
1、屏蔽f12
document.onkeydown = function(){
if(window.event && window.event.keyCode == 123) {
alert("F12被禁用");
event.keyCode=0;
event.returnValue=false;
}
if(window.event && window.event.keyCode == 13) {
window.event.keyCode = 505;
}
if(window.event && window.event.keyCode == 8) {
alert(str+"\n请使用Del键进行字符的删除操作!");
window.event.returnValue=false;
}
}
2、屏蔽右键菜单
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;
}
}
3、屏蔽选中
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;
}
}
4、屏蔽复制
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;
}
}
5、屏蔽剪贴
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;
}
}
6、屏蔽粘贴
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;
}
}
网页屏蔽f12、右键菜单等操作的更多相关文章
- js屏蔽浏览器右键菜单,粘贴,复制,剪切,选中(转)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- WinForm的TextBox限制只能输入数字并且屏蔽默认右键菜单
基于Window消息实现 class TextBoxExt:TextBox { private const int WM_RBUTTONDOWN = 0x0204; private const int ...
- 利用js代码屏蔽f12,右键,粘贴,复制,剪切,选中,操作!!秀!秀!秀!
koala 专注于个人技术分享 屏蔽f12审查 <script> document.onkeydown = function () { if (window.event && ...
- 学习 Message(5): 关于 TApplicationEvents.OnMessage 的第二个参数 可以屏蔽 TWebBrowser右键菜单:
http://www.cnblogs.com/del/archive/2008/10/25/1319318.html TApplicationEvents.OnMessage 的第二个参数 Handl ...
- C# winform 屏蔽鼠标右键 spreadsheet Gear 屏蔽鼠标右键菜单
今天用到spreadsheetGear 插件,然后右键有插件自己的菜单.都是英文的,而且还能打开新的窗体.嵌到程序里面,不太合适,所以着手屏蔽. 刚开始用的Mouse_up,虽然能捕获事件,但是没有K ...
- js屏蔽浏览器右键菜单
<script type="text/javascript"> function doNothing(){ window.event.returnValue=false ...
- js 屏蔽浏览器右键菜单
<script type="text/javascript"> function doNothing(){ window.event.returnValue=false ...
- 在Google Chrome中快速解除网页屏蔽鼠标右键、复制等限制
第一步,将书签栏设置为显示状态! 第二步,添加新书签——>在标签栏点击右键,选择“添加网页”. 第三步,设置新书签的内容. 1.起名.这个凭个人爱好吧 2.网址栏输入: javascript ...
- 手机浏览器中屏蔽img的系统右键菜单context menu
我们知道通过oncontextmenu事件可以屏蔽浏览器右键菜单 $('img').on("contextmenu",function(E){E.preventDefault(); ...
随机推荐
- 2018.4.27 java容器
一.容器的概念 在Java当中,如果有一个类专门用来存放其它类的对象,这个类就叫做容器,或者就叫做集合,集合就是将若干性质相同或相近的类对象组合在一起而形成的一个整体 二.容器与数组的关系 之所以需要 ...
- js post下载相当于 location.href
/** *参数说明: url:下载地址,val:需要提交的参数值,具体类型和个数自行扩展 * 参数可以用obj = {url:""",val1:"111&quo ...
- 数组排序自定义comparator()
案例1:现在有一个普通数组arr = [3,1,2,4,5,6,8,0,1]; 自定义一个排序方法: function createComparator(){ return function (obj ...
- 深入学习Motan系列(五)—— 序列化与编码协议
一.序列化 1.什么是序列化和反序列化? 序列化:将对象变成有序的字节流,里面保存了对象的状态和相关描述信息. 反序列化:将有序的字节流恢复成对象. 一句话来说,就是对象的保存与恢复. 为什么需要这个 ...
- 全志A33 lichee Linux内核原子操作(附实测代码)
开发平台 * 芯灵思SinlinxA33开发板 淘宝店铺: https://sinlinx.taobao.com/ 嵌入式linux 开发板交流 QQ:641395230 原子操作是指不会被线程调度机 ...
- Java_初入IO流_字符流_Write-Read_小笔记
package IO; import java.io.FileWriter; import java.io.IOException; class File_Writer { public static ...
- centos7生产环境下openssh升级
由于生产环境ssh版本太低,导致使用安全软件扫描时提示系统处于异常不安全的状态,主要原因是ssh漏洞.推荐通过升级ssh版本修复漏洞 因为是生产环境,所以有很多问题需要注意.为了保险起见,在生产环境下 ...
- css 样式控制文本过长实现省略号
css 样式控制文本过长实现省略号 .topicTitle{ text-overflow: ellipsis; max-width: 75%; overflow: hidden; white-spac ...
- py-day3-5 python 函数式编程
# 函数式(方程式 y = 2*x+1) def calc(x): return 2*x+1 print('得出的结果:',calc(6)) 得出的结果: 13 # 面向过程 def calc(x): ...
- SpringSecurity-RememberMeAuthenticationFilter的作用
启用remember-me功能,在配置文件中的http节点下添加: <remember-me remember-me-parameter="remember-me" reme ...