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. LDAP学习

    .top pre { display: block; background: rgba(68, 67, 65, 1); color: rgba(255, 255, 255, 1); margin: 1 ...

  2. brew更换国内源

    来源:清华大学开源软件镜像站(https://mirror.tuna.tsinghua.edu.cn/help/homebrew/) 替换现有上游 1 # brew 程序本身,Homebrew/Lin ...

  3. sqlite安装与封装后编译

    ========================安装sqlite=================官网下载安装包*.tar.gz格式./configure --prefix=/usr/server/s ...

  4. arp病毒系列——攻击类型

       到目前为止,我所见闻的arp病毒攻击导致局域网几乎瘫痪的事例已经不下3次了,而且非常巧的​是:每次都是将近学校考试.大批同学新下四楼更新IP-Mac的时候出现!严重的时候你根本就ping不通网关 ...

  5. SpringBoot整合spring-security-oauth2完整实现例子

    SpringBoot整合spring-security-oauth2完整实现例子 技术栈 : springboot + spring-security + spring-oauth2 + mybati ...

  6. vulnhub靶机练习-Os-Hax,详细使用

    Difficulty : Intermediate Flag : boot-root Learing : exploit | web application Security | Privilege ...

  7. Codeforces Round #653 (Div. 3)

    比赛链接:https://codeforces.com/contest/1374 A. Required Remainder 题意 给出 $x, y, n$,找到最大的整数 $0 \le k \le ...

  8. BZOJ2882 工艺【SAM】 最小循环串

    BZOJ2882 工艺 给出一个串,要求其循环同构串中字典序最小的那个 串翻倍建\(SAM\)然后从起点开始贪心的跑\(n\)次即可 当然也能用最小表示法来做 #include<bits/std ...

  9. UVA 10480 Sabotage (最大流最小割)

    题目链接:点击打开链接 题意:把一个图分成两部分,要把点1和点2分开.隔断每条边都有一个花费,求最小花费的情况下,应该切断那些边. 这题很明显是最小割,也就是最大流.把1当成源点,2当成汇点. 问题是 ...

  10. Codeforces Round #634 (Div. 3)

    D题想复杂了,花了好多时间,感觉也没时间看F了,就来写个题解蹭蹭访问量把^_^ 传送门:1335 A. Candies and Two Sisters 题意:你要把n个糖果分给两个人,两个人的糖果数不 ...