Uncaught Exception opening Web Inspector to Debugger Tab Trying to load watch expressions, the panel uses InspectorBackend.runAfterPendingDispatches which tries to use WI.mainTarget.connection but the target doesn't exist it. Lets make it do something if there is no main target.
Created attachment 356041 [details] [PATCH] Proposed Fix
Comment on attachment 356041 [details] [PATCH] Proposed Fix View in context: https://bugs.webkit.org/attachment.cgi?id=356041&action=review r=me > Source/WebInspectorUI/UserInterface/Protocol/Connection.js:82 > + this._deferredScripts.push(callback); NIT: Shouldn't this also be called `_deferredCallbacks` while you're renaming things? > Source/WebInspectorUI/UserInterface/Protocol/InspectorBackend.js:178 > + setTimeout(callback); This won't preserve the order of execution, which I'm not sure is something we entirely care about, but is something to consider nonetheless. Maybe add a `_deferredCallbacks` like `WI.Connection`? Also, instead of directly checking `WI.mainTarget`, could we utilize `WI.whenTargetsAvailable` to fire all `_deferredCallbacks`?
Comment on attachment 356041 [details] [PATCH] Proposed Fix View in context: https://bugs.webkit.org/attachment.cgi?id=356041&action=review >> Source/WebInspectorUI/UserInterface/Protocol/InspectorBackend.js:178 >> + setTimeout(callback); > > This won't preserve the order of execution, which I'm not sure is something we entirely care about, but is something to consider nonetheless. Maybe add a `_deferredCallbacks` like `WI.Connection`? > > Also, instead of directly checking `WI.mainTarget`, could we utilize `WI.whenTargetsAvailable` to fire all `_deferredCallbacks`? Hmm, I should just call it immediately. That will preserve order.
https://trac.webkit.org/r238750
<rdar://problem/46381949>