Status
People
(Reporter: dougt, Unassigned)
Tracking
Bug Flags:
Details
Attachments
(1 obsolete attachment)
Created attachment 338966 [details] [diff] [review] patch v.1 we have code in the mochitests (and I would assume others do things similar) that enumerates all of the chrome windows. For each chrome window, it wants to access each browser window. For example: var ww = Components.classes["@mozilla.org/embedcomp/window-watcher;1"].getService(Components.interfaces.nsIWindowWatcher); var enumerator = ww.getWindowEnumerator(); var contentWindows = []; while (enumerator.hasMoreElements()) { var win = enumerator.getNext(); if (typeof ChromeWindow != "undefined" && win instanceof ChromeWindow) { if (win.gBrowser) { var tabs = win.gBrowser.browsers; for (var i = 0; i < tabs.length; i++) ..... For Fennec, we are not going to have a gBrowser that is equal to the firefox gBrowser. In our case, we can do something like: for each (node in win.getBrowsers()) ...
Attachment #338966 -
Flags: review?(mark.finkle)
Comment 1•11 years ago
|
||
Comment on attachment 338966 [details] [diff] [review] patch v.1 >diff --git a/chrome/content/browser.js b/chrome/content/browser.js >+ >+function getBrowsers() { >+ return Browser.content.getBrowsers(); >+} > I'd like to get more consensus about the naming here. We have a separate bug to cleanup our API a bit, so I want gavin's input here too. getBrowsers() and getBrowser() is a little too close for my liking. > function getBrowser() { > return Browser.content.browser; >diff --git a/chrome/content/deckbrowser.xml b/chrome/content/deckbrowser.xml >+ >+ <method name="getBrowsers"> >+ <body><![CDATA[ >+ var browsers = []; >+ var displayList = this.displayList.childNodes; >+ for (var t = 0; t < displayList.length; t++) { >+ var display = displayList[t]; >+ var browser = this.getBrowserForDisplay(display); >+ if (browser) >+ browsers.push(browser) >+ } >+ return browsers; >+ ]]> >+ </body> > </method> Looks good, but I think I want to use: <property name="browsers" readonly="true"> <getter> ... </getter> </property> like we find in tabbrowser: http://mxr.mozilla.org/seamonkey/source/browser/base/content/tabbrowser.xml#1693
Attachment #338966 -
Flags: review?(mark.finkle)
Attachment #338966 -
Flags: review?(gavin.sharp)
Attachment #338966 -
Flags: review-
(Reporter) | ||
Comment 2•11 years ago
|
||
we probably don't need this now. no longer blocks 455611
Updated•11 years ago
|
Assignee: nobody → gavin.sharp
Flags: wanted-fennec1.0+
Updated•10 years ago
|
Attachment #338966 -
Attachment is obsolete: true
Attachment #338966 -
Flags: review?(gavin.sharp)
Comment 3•10 years ago
|
||
Looks like this is mostly irrelevant now (part of that patch is already in deckbrowser, in fact). We should still think about cleaning up our APIs and making them look similar to Firefox to ease extension porting, but I think we have existing bugs on that?
Assignee: gavin.sharp → nobody
Comment 4•10 years ago
|
||
(In reply to comment #3) > We should still think about cleaning up our APIs and > making them look similar to Firefox to ease extension porting, but I think we > have existing bugs on that? We do - closing this one
Status: NEW → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → WONTFIX
You need to log in
before you can comment on or make changes to this bug.
Description
•