子比主题-禁用F12/右键并提醒,禁止图片拖放,控制台添加说明

代码介绍

网站代码包含:控制台添加版权说明,复制提醒,禁止右键提示,禁止图片拖放,禁用快捷键Ctrl+Shift+I,禁用F12按键并提醒。

操作教程

将下面代码放入子比主题后台自定义javascript代码中:

<!--禁用F12按键并提醒 xiayinge.com-->
document.onkeydown = function () {
if (window.event && window.event.keyCode == 123) {
  event.keyCode = 0;
  event.returnValue = false;
    new Vue({
            data:function(){
                this.$notify({
                    title:"嘿!别瞎按",
                    message:"你按这个想干嘛!",
                    position: 'bottom-right',
                    offset: 50,
                    showClose: false,
                    type:"error"
                });
                return{visible:false}
            }
        })
  return false;
}
<!--禁用Ctrl+Shift+I-->
if ((event.ctrlKey) && (event.shiftKey) && (event.keyCode == 73)) {
event.keyCode = 0;
  event.returnValue = false;
    new Vue({
            data:function(){
                this.$notify({
                    title:"嘿!这个也不行",
                    message:"还是按点别的吧!",
                    position: 'bottom-right',
                    offset: 50,
                    showClose: false,
                    type:"error"
                });
                return{visible:false}
            }
        })
         return false;
}};

<!--禁止图片拖放--> 
    document.ondragstart = function() {
        return false
    };
    <!--禁止右键并提示--> 
    document.oncontextmenu = function() {
        new Vue({
            data: function() {
                this.$notify({
                    title: "嘿!没有右键菜单",
                    message: "右键菜单被偷走了/(ㄒoㄒ)/~~",
                    position: 'bottom-right',
                    offset: 50,
                    showClose: false,
                    type: "warning"
                });
                return {
                    visible: false
                }
            }
        })
        return false;
    }
<!--复制提醒 larenn.cn-->

$(function(){
    if(window.localStorage.getItem("isClose") == 'yes'){
        console.log('Notification通知状态:已关闭');
        return false;
    }else{
        setTimeout(function(){
            new Vue({data:function(){
                this.$notify({
                    title:"签到任务已开放",
                    dangerouslyUseHTMLString:true,
                    message:"本站已经开启签到任务!更多详情可首页侧栏<span style='color: #f00;'> 消息通知 </span>查看",
                    dangerouslyUseHTMLString:true,
                    position:'bottom-right',
                    offset:50,
                    duration:0,
                    type:"success",
                    onClose() {
                        window.localStorage.setItem("isClose", "yes");
                        console.log('Notification通知状态:关闭成功');
                    }
                });
                return{visible:false}
            }});
        },5000);
    }
});


//控制台添加说明 xiayinge.com
if  (window.console) {
     var  cons = console;
     if  (cons) {
       console.log("\n %c 侠隐阁素材网 - https://www.xiayinge.com","color:#fff; background: linear-gradient(to right , #7A88FF, #d27aff); padding:5px; border-radius: 10px;");
       cons.log( "%c\n侠隐阁素材网" ,  "font-size:70px;" );
       console.log('%c网站:侠隐阁素材网(https://www.xiayinge.com)\n说明:如果你通过控制台的方式获取CSS样式或者其他东东,相信你可能也看到本说明。如果你想一声不吭的拿走,请自己把所有涉及到的链接图片保存到本地,谢谢!\n更多精彩文章教程,请收藏本站。','color:red;font-size:20px;');
       console.log('%c ','background-image:url("https://www.xiayinge.com/occ/img/lanren-LOGO-日间.png");background-size:100% 100%;padding:30px 150px;');
     }
};
请登录后发表评论

    没有回复内容