How to make this with js:
If console or Dev Tools is opened will perform function:
function(){
alert('Console is open.');
};
How to make this with js:
If console or Dev Tools is opened will perform function:
function(){
alert('Console is open.');
};
If you are on Chrome you could use:
window.onresize = function()
{
if ((window.outerHeight - window.innerHeight) > 100)
alert('Docked inspector was opened');
}
Also Sindre Sorhus created an applet which you could use to detect whenever dev tools is open or not (https://stackoverflow.com/a/19256983/5252192).
I put some code here to tell what does it do. Head Here and import this in your page. then use the below code to detect when devtools opens or closed (it alerts on change of the state of the devtools).
window.addEventListener('devtoolschange', function (e) {
var adsf = e.detail.open;
if(adsf) {var qwer = "open.";}else{var qwer = "closed."}
window.alert('dev tools is '+qwer);
});
Other possible solutions are Here