adamschwartz / chrome-inspector-detector Goto Github PK
View Code? Open in Web Editor NEWDetect if the Chrome Inspector is open or closed.
Detect if the Chrome Inspector is open or closed.
For everyone using or considering this detector script, can you comment on how you use it / plan to use it?
Chrome is considering removing the detection technique used at the heart of this script and we want to understand how it's used in the wild. (Meanwhile, there are chrome extension APIs to detect when devtools opens/closes)
Thank you!
First of all, awesome job! :) Thanks for creating this.
The demo page always tells me that the devtools are docked (when they are open). I didn't do thorough debugging but here are the values when paused at the if()
condition inside height()
test:
window.outerHeight
1000
zoom
1
window.outerHeight
1000
window.innerHeight
938
window.chrome.inspector._windowHeightOffset
-938
Regarding this site, console.profiles is removed from chromium latest code.
https://codereview.chromium.org/15816002
Chrome 29 beta already does not have console.profiles.
It would be nice to figure out how to do this in IE too. One way to tell, is that window.console is undefined until the dev tools have been opened. However it stays defined, after being closed, so I have no idea, how to detect closing. Perhaps have a look at the HTML code school source, mentioned on SO.
I've been writing some HTML5 based quizzes - this is a good way to tell if someone is trying to cheat. Thanks for the great idea.
Idea from https://news.ycombinator.com/item?id=5431355.
Doesn't seem to be anything out there yet: https://chrome.google.com/webstore/search-extensions/web%20inspector%20events.
The great folks on HN have been finding a number of false positives generated by the window check.
window.outerHeight > (window.innerHeight + window.chrome.inspector._windowHeightOffset) || window.outerWidth > window.innerWidt
Not sure if you're already aware of it (or don't really care because it's Canary), but Canary's inspector is always detected as being in a "docked" state regardless of whether it is docked or undocked.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.