Myk Melez
unread,Dec 31, 2012, 3:33:18 PM12/31/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to mozilla-la...@googlegroups.com
Rocketeers!
When you run an addon with `cfx run` against an existing profile with
the addon already installed, require('self').loadReason is set to
*startup*. But `cfx run` reinstalls the addon, so it seems like
loadReason should be set to *upgrade*, so the addon knows to do tasks it
would normally do after being updated.
(This happens to cause a problem when running the Firefox OS Simulator,
which bundles a Gaia profile, tracks a set of apps the user has
installed in it, and reinstalls the apps into the new Gaia profile when
the addon is updated.)
I also notice that it isn't possible to run the addon with the *install*
loadReason, as `cfx run` on a new profile still sets loadReason to
*startup*.
Ideally, I would want to be able to run an addon with any of the load
reasons, but especially *install*, *startup*, and *upgrade*. Perhaps the
JS version of cfx (bug 631470) will fix this, or at least make it easier
to fix?
One thought for how to expose this functionality is that running `cfx
run` on a new profile could set loadReason to *install*; running it on
an existing profile could (continue to) set it to *startup*; and running
it on an existing profile with an active session could update the addon
in the existing session and set it to *upgrade*.
Alternately, perhaps it would be better to make this more explicit and
have a --loadReason command-line option to `cfx run` that sets it to the
desired value, which users could use with either an existing or a new
profile.
-myk