Live data from Hacker News

Chrome Inspector Detector

adamschwartz.co

21–30 of 92 posts

Re: Chrome Inspector Detector

#21

Earlier quoted context omitted.

Having a non-standard window zoom also sets this off.

I've made the docked/undocked an experimental feature since it was causing the issues you were seeing. Please let me know if you're still seeing any issues with false positives for open.

From quickly checking the code before the reports, you seemed to be first checking for the height thing, and prematurely returning, before running any profiling. Wouldn't you avoid these problems if you first checked for the surer stuff, and then checked the height?

Re: Chrome Inspector Detector

#22

Earlier quoted context omitted.

Having a non-standard window zoom also sets this off.

I've made the docked/undocked an experimental feature since it was causing the issues you were seeing. Please let me know if you're still seeing any issues with false positives for open.

[deleted]

Re: Chrome Inspector Detector

#23

Earlier quoted context omitted.

I've made the docked/undocked an experimental feature since it was causing the issues you were seeing. Please let me know if you're still seeing any issues with false positives for open.

From quickly checking the code before the reports, you seemed to be first checking for the height thing, and prematurely returning, before running any profiling. Wouldn't you avoid these problems if you first checked for the surer stuff, and then checked the height?

@goldfeld absolutely. However, the profiler check mucks up the console output so I was hoping to use it as a fallback. For now I've made it experimental and will keep it that way until we can resolve the issues you pointed out. (https://github.com/adamschwartz/chrome-inspector-detector/is...)

Re: Chrome Inspector Detector

#28
Apologies if this is a silly question, but why is console.clear() needed for this to work?

EDIT: Oh, I get it, it must be housekeeping to clear the log messages generated by the profiler.

Re: Chrome Inspector Detector

#29

console.profile = console.clear = function(){} That's all you need write in the console to stop this annoyance.

Does that make profiling unusable?

It does, but you usually don't want to profile other dev's pages; here is another solution that doesn't make profiling unusable:

    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`
Post reply on HN