Closed Bug 565040 Opened 14 years ago Closed 14 years ago

Can't re-install an extension when the add-ons manager is open in a tab

Categories

(Toolkit :: Add-ons Manager, defect)

defect
Not set
major

Tracking

()

VERIFIED FIXED
mozilla1.9.3a5

People

(Reporter: shadow912kage, Assigned: mossop)

References

Details

(Whiteboard: [rewrite])

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; ja; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.3a5pre) Gecko/20100511 Minefield/3.7a5pre BuildID: 20100511040317

When drag & drop .xpi file to Minefield's add-ons manager tab or Shredder's window, Software Installation dialog isn't shown.
Thus can't install extension.

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.3a5pre) Gecko/20100511 Minefield/3.7a5pre BuildID: 20100511040317
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.3a5pre) Gecko/20100511 Shredder/3.2a1pre BuildID: 20100511035848 

Reproducible: Always

Steps to Reproduce:
1. select Tools > Add-ons, to open Add-ons Manager.
2. drag & drop .xpi file to Add-ons Manager tab/window
3.
Actual Results:  
do nothing...

Expected Results:  
show Software Installation dialog
Version: unspecified → Trunk
Works fine for me with Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.3a5pre) Gecko/20100511 Minefield/3.7a5pre ID:20100511030640

Which extension are you trying to install? Is it compatible with recent Minefield builds?
Blocks: 550048
Whiteboard: [rewrite]
Tested with current 3.7a5pre build (though not hourly).

If I drag an Adblock Plus .xpi file to about:addons (I already have Adblock Plus installation) it marked Adblock Plus wit ha red border and says it's ready to update and I may restart now. (At this point I do miss a possibility to abort the update...)

Therefore: Could not reproduce.
I can confirm it partially.
I can not drag&drop .xpi file to Add-ons Manager window of Shredder/3.2a1pre.

However, The installation succeeded with the following procedure.
drag&drop .xpi file to Message pane, Message tab and/or Message window of Shredder/3.2a1pre and content area and Add-ons Manager of Minefield/3.7a5pre.

Mozilla/5.0 (Windows; U; Windows NT 6.1; WOW64; en-US; rv:1.9.3a5pre) Gecko/20100511 Minefield/3.7a5pre ID:20100511040317

Mozilla/5.0 (Windows; U; Windows NT 6.1; WOW64; en-US; rv:1.9.3a5pre) Gecko/20100511 Shredder/3.2a1pre ID:20100511035848
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: [Addons] Can't install extension .xpi file by drag & drop to add-ons manager tab/window. → [Addons] Can't install extension .xpi file by drag & drop to add-ons manager window of Shredder
sorry for less information.
plz try to re-install existing extension of new version.
(e.g. version 0.1 is installed, then DnD version 0.2 to Add-ons Manager.)
then press restart button.
new version extension is not installed.
Summary: [Addons] Can't install extension .xpi file by drag & drop to add-ons manager window of Shredder → [Addons] Can't re-install extension .xpi file by drag & drop to add-ons manager tab/window
Blocks: 461973
No longer blocks: 550048
This happens for any kind of re-install when the add-ons manager is open in a tab. Blair this seems to be because the UI is trying to start the install here: http://mxr.mozilla.org/mozilla-central/source/toolkit/mozapps/extensions/content/extensions.xml#1048

What is that there for?
Summary: [Addons] Can't re-install extension .xpi file by drag & drop to add-ons manager tab/window → Can't re-install an extension when the add-ons manager is open in a tab
Hmm, at one point, I'm sure that was needed. I'm guessing not now. So removing that .install() call fixes it?
Some debug output I see when I try this:

Warning: WARN addons.manager: InstallListener threw exception when calling onInstallEnded: TypeError: this.mControl.onInstallCompleted is not a function

Error: [Exception... "'Error: Cannot start installing from this state' when calling method: [amIWebInstallListener::onWebInstallRequested]"  nsresult: "0x8057001c (NS_ERROR_XPC_JS_THREW_JS_OBJECT)"  location: "JS frame :: file:///C:/mozilla/firefox/firefox-3.7a5pre.en-US.win32/firefox/modules/AddonManager.jsm :: AMI_installAddonsFromWebpage :: line 508"  data: no]
Source File: file:///C:/mozilla/firefox/firefox-3.7a5pre.en-US.win32/firefox/modules/AddonManager.jsm
Line: 508

Warning: WARN addons.manager: Failure calling web installer: [Exception... "'Error: Cannot start installing from this state' when calling method: [amIWebInstallListener::onWebInstallRequested]"  nsresult: "0x8057001c (NS_ERROR_XPC_JS_THREW_JS_OBJECT)"  location: "JS frame :: file:///C:/mozilla/firefox/firefox-3.7a5pre.en-US.win32/firefox/modules/AddonManager.jsm :: AMI_installAddonsFromWebpage :: line 508"  data: no]

Same results if I try to install from D&D, File->Open, or a bookmark pointing to a local file.
(In reply to comment #6)
> Hmm, at one point, I'm sure that was needed. I'm guessing not now. So removing
> that .install() call fixes it?

Yeah the code handling install fires onNewInstall and then attempts to start the install itself, by which time the UI has already started it so it fails and cancels the install.

I'll put together a patch to remove the call from the UI side.
(In reply to comment #8)
> Some debug output I see when I try this:
> 
> Warning: WARN addons.manager: InstallListener threw exception when calling
> onInstallEnded: TypeError: this.mControl.onInstallCompleted is not a function

Incidentally Blair I've seen this error in a few places and appears to be on the UI side though I haven't seen it actually causing any problems yet.
Attached patch patch rev 1Splinter Review
This probably would have been required back before we had web installs working properly as it is now it is unnecessary.
Assignee: nobody → dtownsend
Status: NEW → ASSIGNED
Attachment #444907 - Flags: review?(bmcbride)
Attachment #444907 - Flags: review?(bmcbride) → review+
(In reply to comment #10)
> (In reply to comment #8)
> > Some debug output I see when I try this:
> > 
> > Warning: WARN addons.manager: InstallListener threw exception when calling
> > onInstallEnded: TypeError: this.mControl.onInstallCompleted is not a function
> 
> Incidentally Blair I've seen this error in a few places and appears to be on
> the UI side though I haven't seen it actually causing any problems yet.

This is interesting - spun it off into bug 565562.
http://hg.mozilla.org/mozilla-central/rev/5d0c740f9408
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.3a5
I've confirmed this issue was fixed on the Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.3a5pre) Gecko/20100514 Minefield/3.7a5pre BuildID: 20100514040039.

Thanks all.
Verified fixed with Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.3a5pre) Gecko/20100517 Minefield/3.7a5pre (.NET CLR 3.5.30729) ID:20100517035949

What can be covered by automated tests? Do we need any manual test?
Status: RESOLVED → VERIFIED
Flags: in-testsuite?
Flags: in-litmus?
Flags: in-litmus? → in-litmus?(vlad.maniac)
Dave, any chance for an automated test? If not I will have to create a manual one.
We test installs by drag and drop into the add-ons manager in http://mxr.mozilla.org/mozilla-central/source/toolkit/mozapps/extensions/test/browser/browser_dragdrop.js so I think this is covered already
Flags: in-testsuite? → in-testsuite+
Based on the automated test I don't think we need a manual one.
Flags: in-litmus?(vlad.maniac) → in-litmus-
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: