D
D
dhat2016-12-01 15:12:22
css
dhat, 2016-12-01 15:12:22

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

6 answer(s)
A
Alexey Yarkov, 2016-12-01
@dhat

Ctrl+Shift+Jworks in Chromium))

D
Dmitry Entelis, 2016-12-01
@DmitriyEntelis

Open in chrome

view-source:http://openssource.biz/zima-na-openssource-pozdravlenie-s-nastupayushhimi-prazdnikami-ot-strimershi-kariny.html
and everything looks great.
Almost at the beginning of the document
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;

The keyCode plate https://www.cambiaresearch.com/articles/15/javascr... 123 is just F12

S
Snewer, 2016-12-01
@Snewer

Can be opened from the menu.
In general, pressing a button on the keyboard is caught and the action is replaced.

A
Anton Sashnin, 2016-12-01
@antonsash

9bfa013f9bdb40da9ee37b4abaecbd21.png

N
Nik Gubin, 2016-12-01
@gubin_niko

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.

I
Ivan Leshchenko, 2016-12-01
@inkluter

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 question

Ask a Question

731 491 924 answers to any question