function fuckyou() {
window.close();
window.location = "about:blank";
}
function ck() {
console.profile();
console.profileEnd();
if (console.clear) {
console.clear()
};
if (typeof console.profiles == "object") {
return console.profiles.length > 0;
}
}
function hehe() {
if ((window.console && (console.firebug || console.table && /firebug/i.test(console.table()))) || (
typeof opera == 'object' && typeof opera.postError == 'function' && console.profile.length > 0)) {
fuckyou();
}
if (typeof console.profiles == "object" && console.profiles.length > 0) {
fuckyou();
}
}
hehe();
window.onresize = function() {
if ((window.outerHeight - window.innerHeight) > 200)
fuckyou();
}
// 动态标题
var OriginTitile = document.title,
titleTime;
document.addEventListener("visibilitychange",
function() {
if (document.hidden) {
document.title = "海螺主题模板-您的模板定制专家!";
clearTimeout(titleTime)
} else {
document.title = "海螺网-欢迎您回家!" ;
titleTime = setTimeout(function() {
document.title = OriginTitile
},
2000)
}
});
document.addEventListener("copy", function(e) {
new Vue({
data: function() {
if ((window.getSelection ? window.getSelection() : document.selection.createRange()
.text) != '') {
this.$notify({
title: "叮!复制成功",
message: "若要转载请务必保留原文链接!谢谢~",
position: 'bottom-right',
offset: 50,
showClose: true,
type: "success"
});
} else {
this.$notify({
title: "咦?复制失败",
message: "啊噢...你没还没选择内容呢!",
position: 'bottom-right',
offset: 50,
showClose: true,
type: "success"
});
}
return {
visible: false
}
}
})
})
document.oncontextmenu = function () {
new Vue({
data:function(){
this.$notify({
title: "嗯?没有右键菜单",
message: "复制请用键盘快捷键[Ctrl+C]",
position: 'bottom-right',
offset: 50,
showClose: false,
type:"warning"
});
return{visible:false}
}
})
return false;
}
document.onkeydown = function(event) {
if (event.ctrlKey && event.keyCode == 83) { // Ctrl + S
event.preventDefault();
new Vue({
data: function() {
this.$notify({
title: "哎!你瞧瞧你",
message: "网页得换方法保存哦~",
position: 'bottom-right',
offset: 50,
showClose: true,
type: "error"
});
return {
visible: false
}
}
})
return false;
}
if (event.ctrlKey && event.keyCode == 85) { // Ctrl + U
event.preventDefault();
new Vue({
data: function() {
this.$notify({
title: "嘿!Brother",
message: "老弟,源码得换方式获取哦~",
position: 'bottom-right',
offset: 50,
showClose: true,
type: "error"
});
return {
visible: false
}
}
})
return false;
}
if (event.ctrlKey && event.shiftKey && event.keyCode == 73) { //
Ctrl + Shift + I
event.preventDefault();
new Vue({
data:function(){
this.$notify({
title:"呐!这个也不行",
message:"还是按点别的吧!",
position: 'bottom-right',
offset: 50,
showClose: false,
type:"error"
});
return{visible:false}
}
})
return false;
}
if (event.keyCode == 123) { // F12
event.preventDefault();
new Vue({
data:function(){
this.$notify({
title:"呃!别瞎按",
message:"你按这个想干嘛!再按就找不到我咯",
position: 'bottom-right',
offset: 50,
showClose: false,
type:"error"
});
return{visible:false}
}
})
return false;
}
};