Bug 190922

Summary: JSContext Inspector: Broken frontend, DOMAgent is used but does not exist
Product: WebKit Reporter: Joseph Pecoraro <joepeck>
Component: Web InspectorAssignee: Joseph Pecoraro <joepeck>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, drousso, inspector-bugzilla-changes, joepeck, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
[PATCH] Proposed Fix none

Description Joseph Pecoraro 2018-10-25 15:46:15 PDT
JSContext Inspector: Broken frontend, DOMAgent is used but does not exist

Steps to Reproduce:
1. Attempt to inspect a JSContext (jsc --remote-debug)
  => Inspector does not show, early error

[Error] ReferenceError: Can't find variable: DOMAgent
	requestDocument (Main.js:23726)
	ensureDocument (Main.js:23728)
	DOMManager (Main.js:23716:340)
	loaded (Main.js:25221:295)
	initialize (Main.js:25693:92)
	Global Code (Main.html:43)
Comment 1 Radar WebKit Bug Importer 2018-10-25 15:46:53 PDT
<rdar://problem/45569827>
Comment 2 Joseph Pecoraro 2018-10-25 15:52:55 PDT
Created attachment 353120 [details]
[PATCH] Proposed Fix
Comment 3 Devin Rousso 2018-10-25 15:55:46 PDT
Comment on attachment 353120 [details]
[PATCH] Proposed Fix

r=me

While I do think this is a valid solution, I think it would better to wrap the `ensureDocument` call in a similar if (or even introduce a `WI.DOMManager.supported()` like some other managers).  I'd prefer to check for support at the construction point rather than right before the call.
Comment 4 Joseph Pecoraro 2018-10-25 16:30:28 PDT
(In reply to Devin Rousso from comment #3)
> Comment on attachment 353120 [details]
> [PATCH] Proposed Fix
> 
> r=me
> 
> While I do think this is a valid solution, I think it would better to wrap
> the `ensureDocument` call in a similar if (or even introduce a
> `WI.DOMManager.supported()` like some other managers).  I'd prefer to check
> for support at the construction point rather than right before the call.

Yes. In the near future, agent's won't be available in Manager construction and things like this will only happen when targets are supported. So this is a simple solution for now.
Comment 5 WebKit Commit Bot 2018-10-25 16:55:20 PDT
Comment on attachment 353120 [details]
[PATCH] Proposed Fix

Clearing flags on attachment: 353120

Committed r237435: <https://trac.webkit.org/changeset/237435>
Comment 6 WebKit Commit Bot 2018-10-25 16:55:21 PDT
All reviewed patches have been landed.  Closing bug.