When do Addons.loadAsTemporaryAddon the install reason should be 5 if the addon wasn't installed. Instead it is 3.

RESOLVED DUPLICATE of bug 1323938

Status

DevTools
about:debugging
P3
normal
RESOLVED DUPLICATE of bug 1323938
2 years ago
11 days ago

People

(Reporter: noitidart, Unassigned)

Tracking

(Blocks: 1 bug)

47 Branch

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

2 years ago
User Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:47.0) Gecko/20100101 Firefox/47.0
Build ID: 20160531183335

Steps to reproduce:

When do Addons.loadAsTemporaryAddon the install reason should be 5 (ADDON_INSTALL) if the addon wasn't installed. Instead it is 3 (ADDON_ENABLE).
(Reporter)

Comment 1

2 years ago
Oops my mistake, the function is `AddonManager.installTemporaryAddon` and it is the same one used when you click the "Load as temoprary addon" from the about:debugging page.
(Reporter)

Updated

2 years ago
Component: Untriaged → Developer Tools: about:debugging
OS: Unspecified → All
Hardware: Unspecified → All

Comment 2

2 years ago
Kumar, could you please have a look at this issue? I'm not sure what the install reason should really be for temporarily loaded add-ons.
Flags: needinfo?(kumar.mcmillan)
Priority: -- → P3
Hi Noitidart.

This was fixed as part of the patch to bug 1269889 . Are you up to date? Feel free to re-open if it's still not giving you the right reason but please also include a simple add-on that reproduces the bug.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 2 years ago
Flags: needinfo?(kumar.mcmillan)
Resolution: --- → FIXED
(Reporter)

Comment 4

2 years ago
(In reply to Kumar McMillan [:kumar] (needinfo all the things) from comment #3)
> Hi Noitidart.
> 
> This was fixed as part of the patch to bug 1269889 . Are you up to date?
> Feel free to re-open if it's still not giving you the right reason but
> please also include a simple add-on that reproduces the bug.

Oo nice! I had just tested on Fx47.
Will test on nightly now.
(Reporter)

Comment 5

2 years ago
Created attachment 8761017 [details]
testing bootstrap.zip

I just tested this. I created a directory with install.rdf and bootstrap.js in it. I then when to about:debugging and did "Load temporary addon" and selected the install.rdf and it is showing me startup reason is "ADDON_ENABLE" :(

It should be "ADDON_INSTALL"

Attached is the zip.

Version of nightly is - 50.0a1 (2016-06-07)
(Reporter)

Comment 6

2 years ago
This is the output on startup into browser console:


aReason: 3              bootstrap.js:5
Object { APP_STARTUP: 1, APP_SHUTDOWN: 2, ADDON_ENABLE: 3, ADDON_DISABLE: 4, ADDON_INSTALL: 5, ADDON_UNINSTALL: 6, ADDON_UPGRADE: 7, ADDON_DOWNGRADE: 8 }             bootstrap.js:6
Thanks for the sample add-on. Sorry about that, this is indeed a bug. I thought it was fixed because the patch I linked to did fix the install() hook but it missed the startup() hook. Until startup() is fixed, you could add this to bootstrap.js which works as expected:

function install(aData, aReason) {
  console.log('install aReason:', aReason);
  console.log({
    APP_STARTUP,
    APP_SHUTDOWN,
    ADDON_ENABLE,
    ADDON_DISABLE,
    ADDON_INSTALL,
    ADDON_UNINSTALL,
    ADDON_UPGRADE,
    ADDON_DOWNGRADE
  });
}


To fix it, this line needs changing:

https://dxr.mozilla.org/mozilla-central/source/toolkit/mozapps/extensions/internal/XPIProvider.jsm#3958-3959

It should be (I think):

    XPIProvider.callBootstrapMethod(addon, file, "startup", installReason);
Blocks: 1226743
Status: RESOLVED → REOPENED
Ever confirmed: true
Resolution: FIXED → ---
(Reporter)

Comment 8

2 years ago
Oh cool thanks for that work around. I actually am using Nightly to install the addon with xpi sig pref false, just for testing. No biggie, thanks!

Updated

a year ago
Status: REOPENED → RESOLVED
Last Resolved: 2 years agoa year ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1323938

Updated

11 days ago
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.