I'm not going to ask how we can block debugging tools or block the inspect element. I want to implement some javascript function as soon as user tries to open devtools as SoundCloud website did.
After some researching SoundCloud site I found this line of code, may be it will help you. They just use console.info at the start:
null != (d = window.console) && d.info && window.console.info('You like to look under the hood? Why not help us build the engine? https://soundcloud.com/jobs');
P.S. At the moment this line of code you can find in this file
Don't know if this will help but this is for the Windows Shortcut.
window.oncontextmenu = function () {
return false;
};
document.addEventListener("keydown", function(event){
var key = event.key || event.keyCode;
if (key == 123) {
return false;
} else if ((event.ctrlKey && event.shiftKey && key == 73) || (event.ctrlKey
&& event.shiftKey && key == 74)) {
return false;
}
}, false);