js & disabled right click & disabled right menu
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的更多相关文章
- js & listen mouse click
js & listen mouse click how to listen mouse click in js https://www.kirupa.com/html5/mouse_event ...
- [转]FireFox与IE 下js兼容触发click事件的代码
本文转自:http://www.jb51.net/article/16549.htm FireFox与IE 下js兼容触发click事件 ,对于需要兼容这两者的朋友,就需要参考下下面的代码了<a ...
- [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 ...
- js和jquery设置disabled属性为true使按钮失效
设置disabled属性为true即为不可用状态. JS: document.getElementByIdx("btn").disabled=true; Jquery: $(& ...
- 项目中遇到的问题:前台 disabled 与 后台disabled
TPRI项目流程,点[保存],“人员”服务器端控件,如果在前台disabled设置,则值会丢失:在后台设置disabled就可以.
- -_-#【JS】element.click()
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title> ...
- js -- 绑定的click addEventListener 事件只触发一次
var btn = document.getElementById('btn'); // 添加事件绑定 btn.addEventListener('click', btnClick, false); ...
- javascript js 完美解决 click 与 dblclick 冲突,并且不会导致click延迟
示例代码: marker.addEventListener("click", function(){ if (!window.markerClicked) { window.mar ...
- 【vue.js】绑定click事件
随机推荐
- Linux下编译安装源码包软件 configure ,make, make install, make test/check, make clean 假目标
http://www.360doc7.net/wxarticlenew/541275971.html 一.程序的组成部分 Linux下程序大都是由以下几部分组成: 二进制文件:也就是可以运行的程序文件 ...
- bzoj 2038(莫队算法)
2038: [2009国家集训队]小Z的袜子(hose) 时间限制: 20 Sec 内存限制: 259 MB 题目描述 作为一个生活散漫的人,小Z每天早上都要耗费很久从一堆五颜六色的袜子中找出一双来 ...
- 关于MongoDB的简单理解(三)--Spring Boot篇
一.前言 Spring Boot集成MongoDB非常简单,主要为加依赖,加配置,编码. 二.说明 环境说明: JDK版本为15(1.8+即可) Spring Boot 2.4.1 三.集成步骤 3. ...
- 【Android初级】教你用两行代码实现“显示/隐藏密码”的效果
Android里面要使用密码的场景是非常多的,支付宝.微信.淘宝以及各大银行APP,都跟用户的密码有关.用户的密码是极为隐私的,用户在输入时不希望密码被别人看到,所以几乎所有需要输入密码的场景下都会把 ...
- ubuntu中如何安装selenium+chrome(headless)无界面浏览器?
selenium是一个Web的自动化测试工具,它可以根据我们的指令,让浏览器自动加载页面,获取需要的数据,甚至页面截屏,或者判断网站上某些动作是否发生.但是它自身不带浏览器,不支持浏览器的功能,因此它 ...
- 大型面试现场:一条update sql执行都经历什么?
导读 Hi,大家好!我是白日梦!本文是MySQL专题的第 24 篇. 今天我要跟你分享的MySQL话题是:"从一条update sql执行都经历什么开始,发散开一系列的问题,看看你能抗到第几 ...
- Linux 输入输出重定向, &>file, 2>&1, 1>&2
Linux 输入输出重定向, &>file, 2>&1, 1>&2 一.1和2在Linux中代表什么 1.1 输出重定向 1.2 输入重定向 1.3 绑定重定 ...
- java架构《并发线程高级篇一》
本章主要记录讲解并发线程的线程池.java.util.concurrent工具包里面的工具类. 一:Executor框架: Executors创建线程池的方法: newFixedThreadPool( ...
- 使用cronolog按日期分割日志
cronologcronolog是一个简单的过滤程序从标准输入读取日志文件条目,每个条目写入到输出文件指定一个文件名模板和当前的日期和时间.当扩大的文件名更改,关闭当前文件,并打开一个新的. cron ...
- shell(shell函数、shell正则表达式)
本章内容 shell函数 shell正则表达式 1.shell函数 linux shell 可以用户定义函数,然后在shell脚本中可以随便调用. 格式: funname () { CMD #函数体 ...