0
<body>

<p>A function is triggered when the user is pressing a key in the input field.</p>

<input type="text" onKeyPress="myFunction()">

<script>
function myFunction() {
  alert("You pressed a key inside the input field");
}


</script>

</body>

found this code where in i need to press f12 inside the input box, please let me know if there is any code to automate this (When chrome opens automatically the developer tool should open)

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
  • Is [this](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/debugger) something you're looking for? – ClydeFrog Jan 29 '20 at 10:50
  • 1
    Does this answer your question? [Can I programmatically open the devtools from a Google Chrome extension?](https://stackoverflow.com/questions/6801577/can-i-programmatically-open-the-devtools-from-a-google-chrome-extension) – Michael Hancock Jan 29 '20 at 11:22
  • Simply, no. Why you want user to open devtools anyway? – Eduard Jacko Jan 29 '20 at 11:39

1 Answers1

0

Nothing that I know of - if anyone proposed this as a feature, it would probably be considered a security risk.

MikeB
  • 580
  • 3
  • 18