Bug 190922 - JSContext Inspector: Broken frontend, DOMAgent is used but does not exist
Summary: JSContext Inspector: Broken frontend, DOMAgent is used but does not exist
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Joseph Pecoraro
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-10-25 15:46 PDT by Joseph Pecoraro
Modified: 2018-10-25 16:55 PDT (History)
5 users (show)

See Also:


Attachments
[PATCH] Proposed Fix (1.39 KB, patch)
2018-10-25 15:52 PDT, Joseph Pecoraro
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.