As per the question title.
Although not required; I would like to stop people from executing functions on my page via the console... Is this even possible?
I've tried a few things, this is the closest I've come - but this doesn't work :(
window.onresize = function(){
if((window.outerHeight - window.innerHeight) > 100) {
//stop commands here?
}
}
window.onload = function() {
if (typeof console !== "undefined" || typeof console.log !== "undefined") {
if (window.console && (window.console.firebug || window.console.exception)) {
//stop commands here?
}
}
}
EDIT:
I don't have to disable the console, just function calls made within it - either solution would be fine though ;)
EDIT2:
So, to get this right... There is now no way of detecting the console crossbrowser at all?
EDIT3:
I've sort of got around it by doing the following, although the JS functions are still in place - the elements that they relate to are not... Not a great fix, but I guess it'll do... :(
setInterval(function() {
if (!$.browser.mozilla) {
if((window.outerHeight - window.innerHeight) > 100) {
alert("DISABLED!");
$('body').remove();
return false;
}
}
if (window.console && (window.console.firebug || window.console.exception)) {
alert("DISABLED!");
$('body').remove();
return false;
}
}, 750);