176 points · by afschwartz · 13y ago · 86 comments
Just the other day I said to my coworker everybody, by now, knew how to use firebug/inspector (he disagreed and, being in support, he does see more suffering than I do) - we were looking at a client site that had a javascript obfuscation of the html source.
It's like this grand battle stage of the worlds tiniest violins.
img.onclick="javascript:function(){alert('Don\'t steal!');return false}" console.profile = console.profileEnd = function () {}; var c = console
var l = console.log
var log = function(){ l.apply(c, arguments) }
Now they can't break the console from working with stuff like: console.log = function(){} var _console = console;
console = undefined;Now you know how to press it.
Your next problem is that much Linux software (Chrome included) insists on using the MS Windows convention of overloading Control for menu shortcuts. This is a great nuisance when you want to be able to use, for example, both Control-V (the conventional LNEXT character in *nix consoles) and GUI-V (the conventional Paste shortcut in GUIs).
Pre-Linux X programs tended to get this right, since they were not focussed on slavishly imitating MS Windows. Apple got it right somewhat accidentally — the original Mac keyboard had no Control key at all, and it got added to support familiar editing and remote terminal uses.
I actually read the Rails articles quite a bit just because I like to not limit what I do or know to a small subset, even if I do not actively use it. Software does not come to other platforms unless one ports it, after all :)
Disclaimer: not a RoR developer, but I do use Python.
I do understand the lack of support for Opera, with it having just a tiny market share in the US, but it still is a form of exclusion.
I'm glad Opera is switching to Webkit & V8 because besides the many websites breaking I found Opera to be much nicer to use than Chrome or Firefox.
I'll continue to improve and update https://github.com/adamschwartz/chrome-inspector-detector/is... with the issues reported here. Thanks.
javascript:clearTimeout(setTimeout(function(){}, 1) - 1); chrome.inspector.detector=function(){return{}};you simply used chrome api :)
Profile 'Profile 13' started. chrome.inspector-detector.js:16
Profile 'Profile 13' finished. chrome.inspector-detector.js:17
Console was clearedEDIT: Oh, I get it, it must be housekeeping to clear the log messages generated by the profiler.
delete window.chrome.inspector
Did I win? console.profile = console.clear = function(){}
That's all you need write in the console to stop this annoyance. chrome.inspector.detector = function(){ return {open:false}}
But a more aggresive solution is this one: console = undefined;
var iframe = document.body.appendChild(document.createElement("iframe"));
iframe.style.display = "none";
window._console = iframe.contentWindow.console
And you can use `_console` instead of `console`Perhaps you're making a game and want to pause it or show wireframes when toggling the inspector.
Or perhaps you're a designer and you want to show a grid layout whenever you're inspecting elements.