Open Bug 865065 Opened 11 years ago Updated 2 years ago

allow makeRemote() on window targets

Categories

(DevTools :: Framework, defect)

defect

Tracking

(Not tracked)

People

(Reporter: harth, Unassigned)

References

Details

Attachments

(2 files, 2 obsolete files)

Opening a devtools window to debug a browser window (running this scratchpad: https://gist.github.com/harthur/5448267), and I get this error in the error console:

Error: TypeError: this.target.makeRemote is not a function
Source File: resource://app/modules/devtools/ProfilerPanel.jsm
Line: 302
Does this still happen? I can't reproduce it on Linux.
Flags: needinfo?(fayearthur)
Yeah, still getting this on a pull from today. None of the remote-able tools work on non-tabs and "this.target.makeRemote is not a function" errors from all the tools.
Flags: needinfo?(fayearthur)
Because the method makeRemote which is present for TabTarget (line 254 of target.js) is missing from WindowTarget. I don't know how it will be implemented, as the makeRemote method assumes that a tab is being attached.

But there is another way of opening toolbox for the window in Nightly : 
>> listen 6666
(or any other number)

Tools > Developer > Connect.. 
type 6666 in the port, localhost in host, connect. Accept the incoming connection, and you are done. All remoteable tools should work
It would be great to be able to inspect other windows as well (e.g. the devtools window itself).

We probably shouldn't have a `WindowTarget` if none of the tools work with it.
Assuming WindowTarget is still useful, the plan was to fold it into TabTarget at some point, the same way we did with RemoteTarget. I can't find a bug for that, so we could use this one for tracking that work.
Attached patch WIP 1 (obsolete) — Splinter Review
This incomplete patch restores the use of the window target for toplevel windows.

It works by exposing toplevel windows as tabs over the debugging protocol when the devtools.chrome.enabled pref is set.

I haven't put much testing into it.

To use the gist in https://gist.github.com/harthur/5447846 you need to open your toolbox in its own window (not docked), and change:


let win = toolbox._host.frame.contentWindow;

to 

let win = toolbox._host._window;
This patch seems to trigger a windowMediator list deadlock as it is.
Attached patch WIP 2 (obsolete) — Splinter Review
This adds a really goofy hack that lets you debug any window (not just toplevels).

This also comments out a line I needed to comment out in the style editor, I'm not sure what's up with it, but things were hanging with that still in.
Attachment #767019 - Attachment is obsolete: true
WIP 2 also fixes the deadlock.
Attached patch WIP 2.1Splinter Review
This time actually folding in the described changes.
Attachment #767025 - Attachment is obsolete: true
Attached patch v1Splinter Review
This removes the hack for non-toplevel windows, but should work otherwise.
Attachment #779538 - Flags: review?(fayearthur)
Comment on attachment 779538 [details] [diff] [review]
v1

This blew up on try, removing r? for now.
Attachment #779538 - Flags: review?(fayearthur)
Product: Firefox → DevTools
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: