Is it possible to execute part of the js file only when opening developer tools?
I need something like
#if DEBUG executeMethodOnlyInDebugger(); #endif
but for javascript.
No, no conditional compilation originally in javascript.
Not really. But you can use devtools-detect . See the following answer: enter the link here
: https://github.com/sindresorhus/devtools-detect
window , , . , , , .
window
, Chrome Firefox. .
IE undefined, . IE :
undefined
if(console){ //dev tools is open } else{ //dev tools not open }
: , Chrome
Source: https://habr.com/ru/post/1612271/More articles:Python copies DLL to site packages on Windows - pythonhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1612267/will-i-break-the-inversion-of-control-principle-if-i-use-andersaol5-repository-in-my-laravel-5-project&usg=ALkJrhj7_qthi2haZRI3DDbIfqId-g1IlAPEP 0008: What does "true XP style" BDFL mean? - pythonhow to filter map value in hive array > - arraysWhy does my foreach loop automatically jump to the third value in the collection? - collectionsHow to sort a ResourceSet in C # - c #How to check if Chrome Dev tools are open? - javascriptCSS negative z-index: what does it mean? - cssListing and memory allocation - c #Custom keyboard name without scheme "KeyboardName - HostAppName" - iosAll Articles