Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when trying to undo pending uninstall of a script #1898

Closed
Ventero opened this issue Mar 22, 2014 · 7 comments
Closed

Error when trying to undo pending uninstall of a script #1898

Ventero opened this issue Mar 22, 2014 · 7 comments
Milestone

Comments

@Ventero
Copy link
Contributor

Ventero commented Mar 22, 2014

Steps to reproduce:

  1. Go to about:addons
  2. Uninstall any script (make sure you have a backup)
  3. Click "undo".

Instead of restoring the script, this triggers TypeError: item.onEnabled is not a function on addons4-overlay.js:69.

It looks like when the observer is called after clicking the "undo" button, the element returned by gListView.getListItemForID(addon.id) is still an addon-uninstalled element (see http://mxr.mozilla.org/mozilla-central/source/toolkit/mozapps/extensions/content/extensions.xml#1703), which doesn't have the onEnabled/onDisabled methods.

Simply dropping the call doesn't seem to be enough either, as then trying to cancel the removal of a disabled script leads to the steps described in #1811. I'm not too familiar with the whole addon manager stuff, but I think this is because during the call to uninstall (http://mxr.mozilla.org/mozilla-central/source/toolkit/mozapps/extensions/content/extensions.xml#1476), the manager sets addon.userDisabled = false and keeps the previous state in a wasDisabled attribute - but when cancelling the uninstallation, we never check that attribute, but instead simply assume it's enabled. Not sure why this isn't handled by the addon manager itself though.

@arantius
Copy link
Collaborator

Works for me in Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:27.0) Gecko/20100101 Firefox/27.0. Step 3 does what I expect. Nothing ends up in the error console.

@jerone
Copy link
Contributor

jerone commented Mar 23, 2014

Confirmed in "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:29.0) Gecko/20100101 Firefox/29.0".

@Ventero
Copy link
Contributor Author

Ventero commented Mar 23, 2014

Ah, sorry, I knew I forgot something: Mozilla/5.0 (X11; Linux x86_64; rv:28.0) Gecko/20100101 Firefox/28.0

@arantius
Copy link
Collaborator

Also WFM in Mozilla/5.0 (X11; Linux x86_64; rv:27.0) Gecko/20100101 Firefox/27.0. Something else is going on, I'm just not sure what.

For those with a confirmed failure, is this in a clean profile? If not, can you please try in one?

@Ventero
Copy link
Contributor Author

Ventero commented Mar 25, 2014

Tried it in a clean profile with only current git HEAD of Greasemonkey installed on Mozilla/5.0 (X11; Linux x86_64; rv:27.0) Gecko/20100101 Firefox/27.0, and I'm able to reproduce the steps in the initial report.

@Ventero
Copy link
Contributor Author

Ventero commented May 11, 2014

Can't reproduce this anymore in Mozilla/5.0 (X11; Linux x86_64; rv:30.0) Gecko/20100101 Firefox/30.0, closing.

@Ventero Ventero closed this as completed May 11, 2014
@Ventero
Copy link
Contributor Author

Ventero commented May 11, 2014

Actually, nevermind, I can still reproduce this - but only when uninstalling/restoring an enabled script (which makes sense, as the error occurs when GM tries to re-enable the script). Maybe this was the reason why you had trouble reproducing this, Anthony?

@Ventero Ventero reopened this May 11, 2014
@arantius arantius added this to the 1.17 milestone May 11, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants