Is there any way to detect whether the Chrome Inspect Element window is running?
For example if the user clicks "Inspect Element" in Chrome, the window shows a Hello World
alert.
Is that possible?
Just right-click and click Inspect Inspect Element, or press Command+Option+i on your Mac or F12 on your PC. In the search field, you can type anything—ANYTHING—that you want to find on this web page, and it will appear in this pane.
Permanent Inspect Element. This extension lets you save the changes you make to a static web page using Inspect Element to remain there even after you refresh the page.
You can copy by inspect element and target the div you want to copy. Just press ctrl+c and then your div will be copy and paste in your code it will run easily.
When you inspect an element, you can change it temporarily. No one else is going to see the change, and you just need to refresh the page to get it back to normal.
UPDATE This no longer works. The property console.profiles
has been removed in Chrome 29.
The only solution that's left is checking the difference between window.outerHeight
and window.innerHeight
as suggested by @Gerben. There is a library devtools-detect based on this method which adds devtoolschange
to the window
object.
Alternatively, there is an effort in progress to create a Chrome extension using a more robust detection method, see this Google Group.
Here's how they check if DevTools are open in the first challenge of Discover DevTools interactive course:
function () { console.profile(); console.profileEnd(); if(console.clear) { console.clear() }; return console.profiles.length > 0; }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With