Open Bug 1269752 Opened 8 years ago Updated 10 months ago

Display tabs grouped by window

Categories

(DevTools :: about:debugging, enhancement, P2)

enhancement

Tracking

(Not tracked)

People

(Reporter: ochameau, Unassigned)

References

Details

Attachments

(2 files)

So far, about:debugging is going to display tabs as a big linear list, ordered by windows and then by tab order in the browser.
It could be helpful to group them by top level window, but it requires improvement to the RootActor/BrowserTabList as listTabs doesn't return any information about windows.
Priority: -- → P2
(Using old-timer SQL vocabulary to make the bug title more precise.)
Summary: Display tabs sorted by window → Display tabs grouped by window
Here's a patch proposal for this bug :)
It's a bit hacky and the UI definitely needs improvement (I guess we shouldn't display window IDs), but I need some feedback before moving forward.

I wasn't sure I would be able to get window information in RootActor/BrowserTabList listTabs, so I used windowEnumerator from about:debugging itself to match each tabActor with a window.
Attachment #8780102 - Flags: feedback?(poirot.alex)
Assignee: nobody → bchabod
Status: NEW → ASSIGNED
Attached image Patch demo
Works great! Thank you for addressing this.

(Not stealing Alex's request for feedback because I don't really understand how these `{window,tab}.outerWindowID`s are supposed work.)
(In reply to Benoit Chabod [:bigben] from comment #2)
> Created attachment 8780102 [details] [diff] [review]
> Group tabs by window in about:debugging
> 
> Here's a patch proposal for this bug :)
> It's a bit hacky and the UI definitely needs improvement (I guess we
> shouldn't display window IDs), but I need some feedback before moving
> forward.

First, in term of UI, I would make it so that, if there is only one window,
we omit displaying the big "Window #1" header.
The ID isn't really useful, but I don't see what we could say other than just "Window".
We may just say window 1, window 2, window 3 based on the natural order, which should reflect the OS order. Or use the z-index order, but that may be misleading.

> I wasn't sure I would be able to get window information in
> RootActor/BrowserTabList listTabs, so I used windowEnumerator from
> about:debugging itself to match each tabActor with a window.

That's not reasonable as it will break for remote devices.
You really have to tweak listTabs or come up with new requests to help doing that window sort.

For example, you could tweak TabActor.form to return helpful additional data:
http://searchfox.org/mozilla-central/source/devtools/server/actors/webbrowser.js#1091-1126
But given that this one is living in the child process, it doesn't have access to the top level window.
You may then modify BrowserTabActor.form which lives in the parent:
http://searchfox.org/mozilla-central/source/devtools/server/actors/webbrowser.js#2266-2278
  let topWindow = this._browser.ownerDocument.defaultView;
  form.topLevelOuterWindowID = topWindow.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils).outerWindowID;

But the outerWindowID doesn't help you much sortering.
You may use another kind of id that you can sort:
  let topWindow = this._browser.ownerDocument.defaultView;
  let windowEnumerator = Services.ww.getWindowEnumerator();
  let index = 0, found = false;
  while (windowEnumerator.hasMoreElements()) {	
    let win = windowEnumerator.getNext();
    if (win == topWindow) {
      found = true;
      break;
    }
    index++;
  }
  if (found) {
    form.topLevelWindowIndex = index;
  }

You may also introduce some new helpers on the RootActor to list top level Windows, list them in explicit order, get their outer window IDs, other metadata...
Attachment #8780102 - Flags: feedback?(poirot.alex)
Severity: normal → enhancement
Product: Firefox → DevTools

This bug has not been updated in the last 6 months. Resetting the assignee field.
Please, feel free to pick it up again and add a comment outlining your plans for it if you do still intend to work on it.
This is just trying to clean our backlog of bugs and make bugs available for people.

Assignee: be.chabod → nobody
Status: ASSIGNED → NEW
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: