js & disabled mouse right button menus

网页可以屏蔽 F12

https://www.cnblogs.com/Marydon20170307/p/9122379.html

view-source:https://www.cnblogs.com/Marydon20170307/p/9122379.html

https://blog-static.cnblogs.com/files/Marydon20170307/include.min.js

https://blog-static.cnblogs.com/files/Marydon20170307/conclusion.min.js

clear selection


var object = this;
this.clearSelect = ("getSelection" in window)
? function () {
window.getSelection().removeAllRanges();
}
: function () {
document.selection.empty();
};

debugger

debugger

https://blog-static.cnblogs.com/files/Marydon20170307/ForbiddenDebug.min.js

full version


"use strict"; /**
*
* @author xgqfrms
* @license MIT
* @copyright xgqfrms
* @created 2018.11.30
* @modified 2018.11.30
*
* @description jquery & forbidden right `Ctrl` button
* @augments
* @example
*
*/ const Generator = (datas = [], debug = false) => {
let result = ``;
// do something...
return result;
}; export default ; export {
,
}; var $get = function (id) {
return document.getElementById(id);
};
var payToMe_5yuan = "https://files.cnblogs.com/files/Marydon20170307/payToMe_5yuan.bmp";
var payToMe_8yuan = "https://files.cnblogs.com/files/Marydon20170307/payToMe_8yuan.bmp";
var payToMe_18yuan = "https://files.cnblogs.com/files/Marydon20170307/payToMe_18yuan.bmp";
var payToMe_28yuan = "https://files.cnblogs.com/files/Marydon20170307/payToMe_28yuan.bmp"; function CreatePageElement() {
var object = this;
this.createForbiddenCopyTipElement = function () {
var forbiddenCopyTipContainer = `
<div id="dotCopyTip" style="position: fixed;">
<div id="dct_children1">
<div id="dct_children1_textTip">
<span style="color:#FFF;">sorry,本博客所有代码禁止复制,原创代码需扫码支付方可获取!<span>
</div>
<a id="dct_children1_closeBtn" onclick="javascript:$(\'#dotCopyTip\').hide(); $(\'#maskCtrl\').hide();" href="javascript:;" title="关闭">关闭</a>
</div>
<div id="dct_children2">
<p>
1、先加好友再付费,
<a href="#article_head" id="dct_children2_click1" onclick="javascript:$(\'#dotCopyTip\').hide();$(\'#maskCtrl\').hide();">点我</a>
加好友
</p>
<p>
2、代码不能满足你的需求?加好友付费定制你的专属代码!
</p>
<p>
3、付费标准及方式,
<a href="javascript:;" id="dct_children2_click2" onclick="javascript:cpe.payButtonClick(\'pay\');">点我</a>
查看详情
</p>
</div>
</div>
`;
return forbiddenCopyTipContainer;
};
this.createPayElement = function () {
var payContainer = `
<div id="knowledgePay" style="position: fixed; left: 32%; bottom: 27%; width: 533px; height: 337px; text-align: center; background: #FAFAFF; z-index: 99999; border: solid 1px #a9a9a9; display: none;">
<div class="title">
<div>请扫描以下二维码支付打赏</div>
<a onclick="$(\'#knowledgePay\').hide();$(\'#maskCtrl\').hide();"onmouseover="this.style.backgroundColor=\'#DF0029\';"onmouseout="this.style.backgroundColor=\'\'" href="javascript:;"title="关闭"></a>
</div>
<div>
<div>
<select id="payType" style="display:none;pointer:cursor;" onchange="cpe.switchPayImg(this.value);">
<option value="0">请选择支付类型</option>
<option value="1">片断源码+技术支持</option>
<option value="2">项目源码+技术支持</option>
<option value="3">私人定制代码服务</option>
</select>
</div>
<img id="payImg" src="" alt="支持原创" />
</div>
</div>
`
return payContainer;
};
this.createDonateElement = function () {
var aTag = `
|<a href="javascript:;" onclick="cpe.payButtonClick(\'bottom\');" style="color:#7fff00;">捐赠</a>
`;
return aTag;
};
this.payButtonClick = function (param) {
if ('pay' == param) {
$('#dotCopyTip').hide();
$('#knowledgePay').show();
$('#payType').show();
$('#maskCtrl').show();
var payType = $get('payType').value;
if (0 == payType) {
$get('payImg').src = '';
}
} else if ('bottom' == param) {
$('#dotCopyTip').hide();
$('#maskCtrl').show();
$('#knowledgePay').css('display', 'block');
$('#payType').hide();
$get('payImg').src = payToMe_5yuan;
}
};
this.switchPayImg = function (num) {
if (1 == num) {
$get('payImg').src = payToMe_8yuan;
} else if (2 == num) {
$get('payImg').src = payToMe_18yuan;
} else if (3 == num) {
$get('payImg').src = payToMe_28yuan;
}
};
this.createPayButtonElement = function () {
var aTag = document.createElement('a');
var cssText = "color:#FFF;padding:4px 10px 4px 8px;border-color:#f57e42;text-decoration:none;background-color:#f57e42;border-radius:9px;display:inline-block;text-align:center;vertical-align:middle;font-size:12px;line-height:1.5;"; aTag.style.cssText = cssText;
aTag.onmouseover = "this.style.textDecoration='none';this.style.color='#666';";
aTag.onmouseout = "this.style.color='#FFF';";
aTag.href = "javascript:cpe.payButtonClick('bottom');";
aTag.innerHTML = " ¥ 我要打赏 ";
return aTag;
};
this.createHelpLikeTextElement = function () {
var spanTag = document.createElement('span');
spanTag.innerHTML = "对你有帮助?请帮忙点赞!";
return spanTag;
};
this.createSubscribeCommentElement = function () {
var subscribeComment = `
<a id="commentbox_opt_sub" href="javascript:void(0);" title="订阅后有新评论时会邮件通知您" onclick="commentManager.Subscribe();">订阅评论</a>
`;
return subscribeComment;
};
this.createMaskElement = function () {
var payTipMaskContainer = `
<div id="maskCtrl" style="position:fixed;z-index:99997;left:0;top:0;width:100%;height:100%;background:rgba(0,0,0,0.7);display:none;"></div>
`;
return payTipMaskContainer;
};
this.createStatisticsElement = function () {
var aTag = `
|<a href="https://www.51.la/?19366069" target="_blank" style="color:#7fff00;">站长统计</a>
`;
return aTag;
};
this.createViewsElement = function () {
var divTag = `
<div id="ajiang_51la"><script type="text/javascript" src="//quote.users.51.la/?id=19366069&mb=3"></script></div>
`;
return divTag;
}
} function PageOperationCtrl() {
var object = this;
this.clearSelect = ("getSelection" in window)
? function () {
window.getSelection().removeAllRanges();
}
: function () {
document.selection.empty();
};
this.accessLimit = function () {
document.oncontextmenu = function () {
window.event.returnValue = false;
return false;
};
document.ondragstart = document.onselectstart = function () {
try {
$('.cnblogs_code').on({
selectstart: function () {
$('#dotCopyTip').show();
$('#maskCtrl').show();
return false;
},
dragstart: function () {
$('#dotCopyTip').show();
$('#maskCtrl').show();
return false;
},
})
.css('cursor', 'pointer');
$('.container').on({
selectstart: function () {
$('#dotCopyTip').show();
$('#maskCtrl').show();
window.event.returnValue = false;
return false;
},
dragstart: function () {
$('#dotCopyTip').show(); $('#maskCtrl').show();
window.event.returnValue = false;
return false;
},
});
} catch (e) {
//
};
window.event.returnValue = false;
return false;
};
document.documentElement.onkeydown = function (e) {
let currKey = 0;
let evt = e || window.event;
currKey = evt.keyCode || evt.which || evt.charCode;
if (currKey == 123) {
$('#dotCopyTip').show();
$('#maskCtrl').show();
}
window.event.cancelBubble = true;
window.event.returnValue = false;
return false;
};
document.oncopy = document.oncut = document.onpaste = function (e) {
window.event.returnValue = false;
return false;
}
}
} function bbbbb() {
this.scrollLoad = function (imgId, imgSrc, distance, title) {
var img_source = $('#' + imgId).attr('src');
if ("" == img_source) {
var documentClientHeight = document.documentElement.clientHeight || window.innerHeight;
var imgOffsetTop = $('#' + imgId)[0].offsetTop;
if (imgOffsetTop < documentClientHeight) {
$('#' + imgId)[0].src = imgSrc;
$('#' + imgId)[0].title = title;
$('#' + imgId)[0].alt = title;
return;
}
var max_imgClientTop = $('#' + imgId)[0].getBoundingClientRect().top;
max_imgClientTop = parseInt(max_imgClientTop);
var max_imgClientDistance = max_imgClientTop - documentClientHeight;
distance = ((distance || 0) > max_imgClientDistance) ? max_imgClientDistance : distance;
if (distance == max_imgClientDistance) {
$('#' + imgId)[0].src = imgSrc;
$('#' + imgId)[0].title = title;
$('#' + imgId)[0].alt = title;
return ;
}
$(document).scroll(function () {
var scrollTop = document.body.scrollTop || document.documentElement.scrollTop;
var imgClientTop = $('#' + imgId)[0].getBoundingClientRect().top;
var clientHeight = documentClientHeight - imgClientTop;
if (-clientHeight <= distance || documentClientHeight >= imgClientTop) {
$('#' + imgId)[0].src = imgSrc;
$('#' + imgId)[0].title = title;
$('#' + imgId)[0].alt = title;
}
})
}
};
this.clickLoad = function (clickId, imgId, imgSrc) {
var img_source = $('#' + imgId).attr('src');
if ("" == img_source) {
$('#' + clickId).click(function () {
$('#' + imgId)[0].src = imgSrc;
});
}
};
} function PageScrollCtrl() {
var heighss = 1300;
var firstStep = true;
var secStep = true;
var isIE = !!window.ActiveXObject;
var isIE8 = isIE && !!document.documentMode;
$(window).load(function () {
$.scrollUp(); $("#scrollUp").text("");
$("#scrollUp").attr("title", "回到顶部")
});
$(window).scroll(function () {
var $sbm = $("#sideBarMain");
var $sbar = $("#sideBar");
var $navc = $("#navigator");
var navH = $navc.offset().top;
var scroH = $(this).scrollTop();
if (scroH >= navH) {
if (firstStep) {
firstStep = false;
$navc.css({ "top": 0, "left": 0, "z-index": "1000" });
$navc.addClass("boxshadow");
}
if (!isIE8 && scroH > heighss && secStep && $sbm.width() > 2) {
secStep = false;
}
if (isIE8 && scroH > heighss && secStep && $sbm.width() > 2) {
secStep = false;
}
} else if (scroH < navH) {
if (!firstStep) {
firstStep = true;
$navc.css({ "margin": "0 auto" });
$navc.removeClass("boxshadow");
}
if (!isIE8 && scroH < heighss && (!secStep) && $sbm.width() < 3) {
secStep = true;
$sbar.show();
}
if (isIE8 && scroH < heighss && (!secStep) && $sbm.width() < 3) {
secStep = true;
}
}
});
} // test function ForbiddenDebug() {
var object = this;
this.isDebug = function () {
var timeLimit = 50;
var startTime = new Date();
debugger;
var endTime = new Date();
if (endTime - startTime > timeLimit) {
$('#topics').remove();
alert('\u68c0\u6d4b\u5230\u975e\u6cd5\u8c03\u8bd5\uff0c\u5373\u5c06\u5237\u65b0\u754c\u9762\uff01');
// 检测到非法调试,即将刷新界面!
window.location.reload();
}
};
this.consoleListener = function () {
setInterval(object.isDebug, 500);
}
} var cpe=new CreatePageElement();
var poc = new PageOperationCtrl();
var ill = new bbbbb();

css3 & user-select

Chrome debug solution

  1. blank page & F12
  2. select DOM
  3. remove css
  4. remove Events

js & disabled mouse right button menus的更多相关文章

  1. js & listen mouse click

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

  2. js & disabled right click & disabled right menu

    js & disabled right click (() => { const log = console.log; log(`disabled copy`); document.bo ...

  3. Bootstrap的js插件之按钮(button)

    1)属性: data-loading-text="载入中..."--使button呈现载入状态: data-toggle="button"--使按钮可以切换状态 ...

  4. js中submit和button的区别

    今天写一个js验证 遇到点小坑 记录一下 button-普通按钮,submit-提交按钮. submit是button的一个特例,也是button的一种,它把提交这个动作自动集成了,submit和bu ...

  5. js点击按钮button效果(波效果)

    Material Design风格纯js按钮点击波特效 演示效果 html部分: <button data-ripple> Demo button 6 </button> cs ...

  6. JS实现 点击button(copy) 复制对应的网址——类似于复制推广链接

    <form action=""> <input type="text" class="share-input" value ...

  7. 点滴积累【JS】---JS小功能(button选择颜色)

    效果: 代码: <head runat="server"> <title></title> <style type="text/ ...

  8. JS和JQuery实现Button绑定键盘Enter事件实现提交

    JavaScript实现方法 document.onkeydown = function(e) { if (!e) e = window.event;//火狐中是 window.event if (( ...

  9. bootstrap插件学习-bootstrap.button.js

    先看bootstrap.button.js的结构 var Button = function ( element, options ){} //构造器 Button.prototype = {} // ...

随机推荐

  1. hibernate连接oracle数据库进行查询

    按主键查询 dao层 public Emp get(Serializable id){ //通过session的get方法根据加载指定对象 return (Emp)HibernateUtil.curr ...

  2. Asp.Net Core 使用Docker进行容器化部署(二)使用Nginx进行反向代理

    上一篇介绍了Asp.Net 程序在Docker中的部署,这篇介绍使用Nginx对Docker的实例进行反向代理 一.修改Nginx配置文件 使用winscp链接Liunx服务器,在/ect/nginx ...

  3. PLC编码规范

    PC在编码规范方面比PLC要好很多.既然它们都是编程语言,那么PC方面的规范是否可以用与PLC呢?答案是肯定的,但需要作取舍.下面规范中的大部分可以用于一般PLC,其中有些只是针对西门子博途,使用时需 ...

  4. python2.7练习小例子(二十四)

        24):1.题目:利用递归方法求5!.     程序分析:递归公式:fn=fn_1*4! #!/usr/bin/python # -*- coding: UTF-8 -*- def fact( ...

  5. P1103 书本整理

    P1103 书本整理 题目描述 Frank是一个非常喜爱整洁的人.他有一大堆书和一个书架,想要把书放在书架上.书架可以放下所有的书,所以Frank首先将书按高度顺序排列在书架上.但是Frank发现,由 ...

  6. DecimalFormat的用法

    DecimalFormat 是 NumberFormat 的一个具体子类,用于格式化十进制数字. DecimalFormat 包含一个模式 和一组符符号含义:  0 一个数字 # 一个数字,不包括 0 ...

  7. Java笔试题-线程编程方面

      Ja 线程编程方面 60.java中有几种方法可以实现一个线程?用什么关键字修饰同步方法?stop()和suspend()方法为何不推荐使用? 答:有两种实现方法,分别是继承Thread类与实现R ...

  8. 【廖雪峰老师python教程】——map/reduce

    Map[单个操作对不同单一对象重复进行] map()函数接收两个参数,一个是函数,一个是Iterable,map将传入的函数依次作用到序列的每个元素,并把结果作为新的Iterator返回. 返回结果注 ...

  9. SSH公钥认证(码云)

    开发者向码云版本库写入最常用到的协议是 SSH 协议,因为 SSH 协议使用公钥认证,可以实现无口令访问,而若使用 HTTPS 协议每次身份认证时都需要提供口令.使用 SSH 公钥认证,就涉及到公钥的 ...

  10. 《python核心编程第二版》第8章习题

    8–1. 条件语句. 请看下边的代码 # statement Aif x > 0:# statement Bpasselif x < 0:# statement Cpasselse:# s ...