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


js & disabled right click & disabled right menu的更多相关文章

  1. js & listen mouse click

    js & listen mouse click how to listen mouse click in js https://www.kirupa.com/html5/mouse_event ...

  2. [转]FireFox与IE 下js兼容触发click事件的代码

    本文转自:http://www.jb51.net/article/16549.htm FireFox与IE 下js兼容触发click事件 ,对于需要兼容这两者的朋友,就需要参考下下面的代码了<a ...

  3. [React] Close the menu component when click outside the menu

    Most of the time, your components respond to events that occur within the component tree by defining ...

  4. js和jquery设置disabled属性为true使按钮失效

    设置disabled属性为true即为不可用状态. JS: document.getElementByIdx("btn").disabled=true;   Jquery: $(& ...

  5. 项目中遇到的问题:前台 disabled 与 后台disabled

    TPRI项目流程,点[保存],“人员”服务器端控件,如果在前台disabled设置,则值会丢失:在后台设置disabled就可以.

  6. -_-#【JS】element.click()

    <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title> ...

  7. js -- 绑定的click addEventListener 事件只触发一次

    var btn = document.getElementById('btn'); // 添加事件绑定 btn.addEventListener('click', btnClick, false); ...

  8. javascript js 完美解决 click 与 dblclick 冲突,并且不会导致click延迟

    示例代码: marker.addEventListener("click", function(){ if (!window.markerClicked) { window.mar ...

  9. 【vue.js】绑定click事件

随机推荐

  1. Promise 中reject 和 catch 处理上有什么区别

    reject 是用来抛出异常,catch 是用来处理异常reject 是 Promise 的方法,而 catch 是 Promise 实例的方法reject后的东西,一定会进入then中的第二个回调, ...

  2. 熟悉而陌生API:Promise

    前言 ES6 发布到现在差不多有5年时间了.在这5年时间里ES6摧枯拉朽般的将现代前端"改朝换代",Promise是其中"大将"般的存在,影响着无数的前端库和A ...

  3. Hive基于MapReduce运行过程

    原文链接https://www.cnblogs.com/felixzh/p/8604188.html Map阶段包括: 第一读数据:从HDFS读取数据 1.问题:读取数据产生多少个Mapper? Ma ...

  4. sourcetree注册

    http://www.cnblogs.com/xiofee/p/sourcetree_pass_initialization_setup.html

  5. 华三交换机NTP配置

    clock protocol ntp ntp-service enable ntp-service unicast-server x.x.x.x clock timezone beijing add ...

  6. (19)ln命令:在文件之间建立链接(硬链接和软链接)

    1.ext 文件系统(Linux 文件系统)是如何工作的. 我们在前面讲解了分区的格式化就是写入文件系统,而 Linux 目前使用的是 ext4 文件系统.如果用一张示意图来描述 ext4 文件系统 ...

  7. CCF-I'm stuck!(BFS)

    I'm stuck!   问题描述 给定一个R行C列的地图,地图的每一个方格可能是'#', '+', '-', '|', '.', 'S', 'T'七个字符中的一个,分别表示如下意思: '#': 任何 ...

  8. Dedecms织梦搜索页显示条数的更改方法

    织梦dedecms搜索结果页面的显示条数默认是10条,这个数值在模板当中是不能控制的. 解决方法: 打开根目录下的plus文件夹,找到search.php修改一段代码: 在大概第15行,找到 $ pa ...

  9. codeforces632D. Longest Subsequence (最小公倍数)

    You are given array a with n elements and the number m. Consider some subsequence of a and the value ...

  10. ACM#学习心得0

    加入实验室也有些日子了,这是第一个近来的小小学习心得 1.在之前的训练题和考核题以及平时刷过的题中,我发现自己对字符串这一块的基础知识掌握还是比较差的,总是不能正确的接收的字符或字符串. 这两个星期, ...