If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

[Firefox 4.0b8+]Blank panel id returned by browser.parentNode.id

VERIFIED INVALID

Status

()

Firefox
Tabbed Browser
VERIFIED INVALID
7 years ago
7 years ago

People

(Reporter: John Engler, Unassigned)

Tracking

Trunk
x86
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

(Reporter)

Description

7 years ago
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.13) Gecko/20101206 Ubuntu/10.04 (lucid) Firefox/3.6.13 UsableLogin
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.13) Gecko/20101206 Ubuntu/10.04 (lucid) Firefox/3.6.13 UsableLogin

Firefox 4 specific. Tested against Firefox 4.0b8 and Minefield 4.09pre (2011-01-07).
From a JavaScript XUL add-on, running gBrowser.getBrowserForDocument(document).parentNode.id returns a blank string. Previous to Firefox 4.*, a panel ID would be returned (e.g. 'panel12345')

Reproducible: Always

Steps to Reproduce:
1. Create a Firefox 4 XUL extension that registers a page load event listener. Have the extension evaluate the following statement, where doc is the document supplied by the page load event listener: "gBrowser.getBrowserForDocument(doc).parentNode.id"
2. Navigate to gmail.com or any other page.
3. Upon arriving the output of the above statement should be a blank string.
Actual Results:  
A blank string instead of a unique panel ID.

Expected Results:  
A valid panel ID.

Updated

7 years ago
Version: unspecified → Trunk

Updated

7 years ago
Blocks: 596371

Comment 1

7 years ago
For Firefox 4, the DOM hierarchy has been changed, so use gBrowser.getBrowserForDocument(document).parentNode.parentNode.id

See here:
https://mxr.mozilla.org/mozilla-central/source/browser/base/content/tabbrowser.xml#284
and the change:
https://hg.mozilla.org/mozilla-central/diff/e7fd6c393c98/browser/base/content/tabbrowser.xml

If there is documentation on this that needs to be updated, let us know.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → INVALID
Better yet, use:
gBrowser.getNotificationBox(gBrowser.getBrowserForDocument(document)).id

(there may be more efficient ways to do this depending on what you're actually starting with)
(Reporter)

Comment 3

7 years ago
That was a failure on my part for not checking the DOM hierarchy. Thank you for the help.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.