5

How can I find out if there is Javascript code listening/intercepting keyboard events and ideally find the exact line/location in the code (e.g. in ChromeDev Tools)?

Rishikesh Dhokare
  • 3,559
  • 23
  • 34
Yolgie
  • 268
  • 3
  • 16

3 Answers3

3

My Answer is for Chrome Browser

You can read more about these API

You can also observe these events from the Dev tools

enter image description here

Hyyan Abo Fakher
  • 3,497
  • 3
  • 21
  • 35
2

I don't know on others brows but at least in chrome console in elements tab on the right side you can open the Event Listeners tab and see them all, moreover clicking on it You will find where they have been set.enter image description here

fedeghe
  • 1,243
  • 13
  • 22
0

<div>
    <input type = "text" onkeydown="funct(event)"/>
</div>
 
<script>
     
function funct(e) {
   console.log(e);
}

</script>

function funct(e){
  console.log(e);
}
<div>
   <input type = "text" onkeydown="funct(event)"/>
</div>

Now run the program and go to inspect element --> console. when you will enter some text in input box you will get all the listing of events fired in console

asifsaho
  • 507
  • 1
  • 4
  • 20
Deepak Verma
  • 617
  • 5
  • 18
  • This gives information about all the events fired in this element, not all listeners on page – Yolgie Jul 26 '18 at 07:40