[Debug] Debug and inspect event listeners with Devtools

Answer1215 / 2023-06-02 / 原文

You can use getEventListeners(button)directly inside chrome devtool, but not inside application code.

 

You can use monitorEvents(button, 'keydown'), now every times keydown happens, event will be logged into the console.

Use unmonitorEvents(button, 'keydown')to stop.