问题
I'm trying to track which element gets focus in a web app. I came across the monitorEvents API, but I'm having difficulty using it for control
or focus
events. Other events on body
are working as expected, but not the control
events. Any advice?
回答1:
I'm not sure how exactly you want to "monitor" control
events, but you can set event listener breakpoints on the entire category, or individual events like focus
. Whenever a focus
listener runs for any node on the page, DevTools pauses on the first line of the listener.
来源:https://stackoverflow.com/questions/43261136/how-can-i-monitor-focus-events-in-chrome