Closed Bug 1402703 Opened 7 years ago Closed 7 years ago

"TypeError: invalid 'in' operand browser" in tabbrowser.xml when a window without location bar is opened

Categories

(Firefox :: Tabbed Browser, defect)

55 Branch
defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: robwu, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: regression)

STR:

1. Open a window without location bar, e.g. by turning on Chrome debugging (at about:debugging for instance) and running the following snippet from the global JS console (Ctrl-Shift-J):

open('http://example.com', '_blank', 'chrome=no,dialog=no,location=0')

(or, from a WebExtension, browser.windows.create({type: 'popup'}); )

2. Look at the global browser console.

Expected:
- No errors

Actual:
- The global JS console has the following error (from Firefox Nightly 57.0a1, buildID 20170913100125):



TypeError: invalid 'in' operand browser[Learn More]  tabbrowser.xml:2408:1
	_insertBrowser chrome://browser/content/tabbrowser.xml:2408:1
	getRelatedElement chrome://browser/content/tabbrowser.xml:7024:11
	set_selectedIndex chrome://global/content/bindings/tabbox.xml:406:31
	tabs_XBL_Constructor chrome://global/content/bindings/tabbox.xml:275:13
	<anonymous> chrome://browser/content/tabbrowser.xml:46:9
	tabbrowser_XBL_Constructor chrome://browser/content/tabbrowser.xml:5782:11

The stack trace points to https://searchfox.org/mozilla-central/rev/56ad02e34d0d36ca4d5ccaa885d26aff270b8ff7/browser/base/content/tabbrowser.xml#2407
The line number seems to be off by one, the actual source of the error is the previous line:
https://searchfox.org/mozilla-central/rev/56ad02e34d0d36ca4d5ccaa885d26aff270b8ff7/browser/base/content/tabbrowser.xml#2406

mozregression points to https://hg.mozilla.org/integration/mozilla-inbound/rev/a03617861cb6 from bug 1345090.
I'm guessing this is caused by bug 1401846 (along with maybe several other bugs with errors like this.)  bug 1345090 may have changed things enough to make the race condition between tabbox constructor and tabbrowser constructor more evident.
I still don't think webextensions should be creating these windows in the first place. It adds a large untested set of UI to Firefox that is bound to continuously have issues like this, and that's besides all the security issues with doing something like this.
Blocks: 1400252
I agree with Gijs. If there's any bug here, we should ignore the chrome=no.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.