RESOLVED FIXED 200233
Web Inspector: DOM: provide a way to disable/breakpoint all event listeners for a given DOM node or event type
https://bugs.webkit.org/show_bug.cgi?id=200233
Summary Web Inspector: DOM: provide a way to disable/breakpoint all event listeners f...
Daniel Bates
Reported 2019-07-29 11:46:03 PDT
Today I wanted to quickly diagnose an issue on google.com on iOS, I needed to find the event listeners that was preventing two finger double tapping a link be recognized. Web Inspector lets me toggle individual event listeners for each event, but on google.com (and other sites) they frequently addEventListener() multiple handlers for the same event. It would be a time saver if I could enable/disable or break on all event listeners for the same event. **My first thought is to recognize Option + clicking the Enable or Breakpoint checkbox for one event listener to toggle enabling or disabling the same checkbox on all event listeners for that event.**
Attachments
Patch (17.40 KB, patch)
2019-07-30 16:00 PDT, Devin Rousso
no flags
[Image] After Patch is applied (141.95 KB, image/png)
2019-07-31 00:13 PDT, Devin Rousso
no flags
Patch (17.51 KB, patch)
2019-07-31 13:01 PDT, Devin Rousso
no flags
Devin Rousso
Comment 1 2019-07-30 16:00:36 PDT
Joseph Pecoraro
Comment 2 2019-07-30 19:00:40 PDT
This deserves a screenshot!
Devin Rousso
Comment 3 2019-07-31 00:13:08 PDT
Created attachment 375216 [details] [Image] After Patch is applied
Joseph Pecoraro
Comment 4 2019-07-31 11:53:15 PDT
Comment on attachment 375191 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=375191&action=review Nice! r=me > Source/WebInspectorUI/UserInterface/Controllers/DOMManager.js:82 > + return !!InspectorBackend.domains.DOM && !!InspectorBackend.domains.DOM.setEventListenerDisabled; This could be written as: return !!(InspectorBackend.domains.DOM && InspectorBackend.domains.DOM.setEventListenerDisabled) To avoid too many !s > Source/WebInspectorUI/UserInterface/Controllers/DOMManager.js:87 > + return !!InspectorBackend.domains.DOM && !!InspectorBackend.domains.DOM.setBreakpointForEventListener && !!InspectorBackend.domains.DOM.removeBreakpointForEventListener; Ditto > Source/WebInspectorUI/UserInterface/Views/EventListenerSectionGroup.js:98 > + return !!this._eventListener.eventListenerId; Hmm, when does this happen? It seems that if this happens then the Gear menu will only ever show "Disable Event Listeners" because this one can not be disabled.
Devin Rousso
Comment 5 2019-07-31 12:58:21 PDT
Comment on attachment 375191 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=375191&action=review >> Source/WebInspectorUI/UserInterface/Views/EventListenerSectionGroup.js:98 >> + return !!this._eventListener.eventListenerId; > > Hmm, when does this happen? It seems that if this happens then the Gear menu will only ever show "Disable Event Listeners" because this one can not be disabled. This is for compatibility, as `eventListenerId` was added within the last year. If it's missing, we don't show the Gear menu at all.
Devin Rousso
Comment 6 2019-07-31 13:01:34 PDT
WebKit Commit Bot
Comment 7 2019-07-31 13:43:39 PDT
Comment on attachment 375238 [details] Patch Clearing flags on attachment: 375238 Committed r248052: <https://trac.webkit.org/changeset/248052>
WebKit Commit Bot
Comment 8 2019-07-31 13:43:40 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 9 2019-07-31 13:44:17 PDT
Joseph Pecoraro
Comment 10 2019-07-31 13:49:20 PDT
> This is for compatibility, as `eventListenerId` was added within the last > year. If it's missing, we don't show the Gear menu at all. Ohh, the makes sense thanks. This could use a COMPATIBILITY comment then.
Daniel Bates
Comment 11 2019-07-31 19:31:59 PDT
πŸ₯³πŸ₯‚πŸΈπŸΎπŸ»
Note You need to log in before you can comment on or make changes to this bug.