Last Comment Bug 851242 - Opening the Add-ons Manager via the -chrome command line switch doesn't load add-on list correctly
: Opening the Add-ons Manager via the -chrome command line switch doesn't load ...
Status: RESOLVED FIXED
:
Product: Toolkit
Classification: Components
Component: Add-ons Manager (show other bugs)
: 20 Branch
: All All
: -- normal (vote)
: mozilla23
Assigned To: Sachin Hosmani [:sachin]
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-03-14 12:03 PDT by Liwen Guo
Modified: 2013-04-23 10:04 PDT (History)
3 users (show)
blair: in‑testsuite-
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Verfifies that windows.arguments[0] is not null (1002 bytes, patch)
2013-04-21 01:48 PDT, Sachin Hosmani [:sachin]
blair: review+
Details | Diff | Splinter Review

Description Liwen Guo 2013-03-14 12:03:00 PDT
User Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:20.0) Gecko/20100101 Firefox/20.0
Build ID: 20130307075451

Steps to reproduce:

Some of us prefer the old way of displaying the addon manager in its own dialog instead of another tab. You can do this by calling Firefox from the command line as follows: "firefox -chrome about:addons"

(alternatively, replace "about:addons" with "chrome://mozapps/content/extensions/extensions.xul" – I guess this is the more correct way, though it doesn't affect this bug)


Actual results:

Firefox will open the addon manager, but the addon list (on the right) will either display a loading indicator or simply stay blank (white) indefinitely. This happens regardless of which category (addons, plugins, themes etc.) is initially selected.

The only way to get the list to show up is by clicking any category label, even the selected one.


Expected results:

Just like when opening the addon manager normally (through the menu or with about:addons), the initially selected category should load the addon list immediately.
Comment 1 Virgil Dicu [:virgil] [QA] 2013-03-19 05:42:31 PDT
I can reproduce this with Ubuntu. Loading dialog will be displayed when using "firefox -chrome about:addons" until selecting any category.

Reproducible on Firefox 10 as well.
Comment 2 Sachin Hosmani [:sachin] 2013-04-18 07:58:40 PDT
I was looking into this.
When I tried the same thing, I got this in my console : 

> JavaScript error: chrome://mozapps/content/extensions/extensions.js, line 103: invalid 'in' operand window.arguments[0]

That was because window.arguments[0] was being null.
So, some necessary arguments are not being passed into the new addons manager window created.

Is an openDialog call bringing the new window up?

If someone can guide me further, I could take this up.
Comment 3 Blair McBride [:Unfocused] (UNAVAILABLE) 2013-04-20 23:55:13 PDT
Thanks, Sachin :)

In that case, we just need an additional check on that line to ensure window.arguments[0] is an object, but also isn't null.

I wouldn't worry about tracing where the values of window.arguments is coming from. Opening things via the -chrome command line flag is a bit weird, and ancient code - changing that would likely break other things. Instead, we should just have better checks in the Add-ons Manager to ensure the inputs are what we expect.

I also wouldn't worry about adding an automated test for this, as opening it via the -chrome flag isn't something we support (but it'd still be nice to fix, especially since it looks like it'll be an easy fix).
Comment 4 Sachin Hosmani [:sachin] 2013-04-21 01:48:55 PDT
Created attachment 740065 [details] [diff] [review]
Verfifies that windows.arguments[0] is not null

It works now.
Comment 5 Blair McBride [:Unfocused] (UNAVAILABLE) 2013-04-22 23:03:01 PDT
https://hg.mozilla.org/integration/fx-team/rev/80a8d5d7db46
Comment 6 Tim Taubert [:ttaubert] (on PTO, back Aug 29th) 2013-04-23 10:04:15 PDT
https://hg.mozilla.org/mozilla-central/rev/80a8d5d7db46

Note You need to log in before you can comment on or make changes to this bug.