Live data from Hacker News

Chrome Inspector Detector

adamschwartz.co

41–50 of 92 posts

Re: Chrome Inspector Detector

#41
post #25

How do I press ⌘ on Linux?

It's becoming increasing clear that on HN you're a second class citizen if you don't use Chrome on a Mac and develop on RoR.

Since when I signed up, ~1500 days ago, it was like this. Except everyone used Safari because FF was extremely laggy on OS X.

Re: Chrome Inspector Detector

#42

A developer could use this to kill all the DOM nodes on the page when the console was opened. This might be the next generation of: img.onclick="javascript:function(){alert('Don\'t steal!');return false}"

Well ... people who know how to use the inspector also know how to get the content without using the inspector. Although it would be significantly more annoying.

Re: Chrome Inspector Detector

#46

A developer could use this to kill all the DOM nodes on the page when the console was opened. This might be the next generation of: img.onclick="javascript:function(){alert('Don\'t steal!');return false}"

but then we could just ensure that this line gets called first

  console.profile = console.profileEnd = function () {};

Re: Chrome Inspector Detector

#47
post #24

Defeated: javascript:clearTimeout(setTimeout(function(){}, 1) - 1);

But what if he starts using setInterval? A more global solution is to: Open the "sources" panel, click on "Event Listener Breakpoints", then click "set Timer" and just delete the lines where it is calling the detector function.

    chrome.inspector.detector=function(){return{}};

Re: Chrome Inspector Detector

#48

Earlier quoted context omitted.

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 us…

It may not be clear, but the main use case for this app is not to harm someone, but to aid in development. 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.

It would be nice to have DOM events (just like onResize), which would only be activated when activating the related option in the console (just like the "Show XHR requests" option).

[edit] https://code.google.com/p/chromium/issues/detail?id=223418

Re: Chrome Inspector Detector

#49
post #25

How do I press ⌘ on Linux?

It's becoming increasing clear that on HN you're a second class citizen if you don't use Chrome on a Mac and develop on RoR.

I think you're confusing popularity with exclusion. Doesn't bother me or make me feel like an outsider because I use Opera as my primary browser and mostly Linux/Windows PCs. It's all a frame of mind and such statements are not really needed on HN because it's really not true.

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.

Re: Chrome Inspector Detector

#50

A developer could use this to kill all the DOM nodes on the page when the console was opened. This might be the next generation of: img.onclick="javascript:function(){alert('Don\'t steal!');return false}"

but then we could just ensure that this line gets called first console.profile = console.profileEnd = function () {};

Not only that, you have to save a reference to the parts of the console that you want to use just in case they attempt to destroy those.

    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(){}
Post reply on HN