Answer the question
In order to leave comments, you need to log in
How is copy protection done, even DevTools does not open?
Actually, here are these pretzels - openssource.biz/zima-na-openssource-pozdravlenie-s...
For the first time I see that even F12 does not open. I didn’t even think that it was possible to block it somehow.
Answer the question
In order to leave comments, you need to log in
Open in chrome
view-source:http://openssource.biz/zima-na-openssource-pozdravlenie-s-nastupayushhimi-prazdnikami-ot-strimershi-kariny.html
and everything looks great. document.onkeypress = function(event) {
event = (event || window.event);
if (event.keyCode === 123) {
//alert('No F-12');
return false;
}
};
document.onmousedown = function(event) {
event = (event || window.event);
if (event.keyCode === 123) {
//alert('No F-keys');
return false;
}
};
document.onkeydown = function(event) {
event = (event || window.event);
if (event.keyCode === 123) {
//alert('No F-keys');
return false;
}
};
function contentprotector() {
return false;
}
document.oncontextmenu = contentprotector;
document.onmouseup = contentprotector;
var isCtrl = false;
window.onkeyup = function(e)
{
if (e.which === 17)
isCtrl = false;
}
window.onkeydown = function(e)
{
if (e.which === 17)
isCtrl = true;
if (((e.which === 85) || (e.which === 65) || (e.which === 80) || (e.which === 88) || (e.which === 67) || (e.which === 83)) && isCtrl === true)
{
return false;
}
}
isCtrl = false;
document.ondragstart = contentprotector;
Can be opened from the menu.
In general, pressing a button on the keyboard is caught and the action is replaced.
Ctrl+Shift+i quite successfully opens the code inspector in Opera. And as implemented, Stepan Romanov has already answered, there is nothing to add. You catch keystroke events, check the key codes and throw out, for example, "return false". The same with the mouse.
Most likely, there are handlers for the keyboard shortcut and the right mouse button.
But the developer panel can be easily opened by clicking on the settings button in the upper right corner, More tools => Developer Tools.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question