I just did a bit of investigation on this, and my impression is that
it's probably still in the process of being implemented, or at least
made user friendly. Specifically, as I understand it, there are two
ways privileged app installation could work:
A) Installation via remote debug protocol. This is the way to side-load
privileged apps onto the phone. However, Firefox desktop seems to not
want to do this. If I run Firefox Nightly and enable remote debugging
and tell it to listen on a port and then connect to that Firefox
Instance from the new WebIDE, it doesn't work. There's an explicit
guard in
http://dxr.mozilla.org/mozilla-central/source/toolkit/devtools/server/actors/webapps.js#812
that throws an error when it tries to launch, ostensibly after the
install is completed (the app shows up in PROFILE/webapps/). However if
I comment out that guard, things still don't work. If I directly browse
the Firefox instance via the app protocol, it also does not work.
B) Installation via standard marketplace mechanism. Because you want
your app to be privileged, I think this requires your app to already be
reviewed in the market or for you to be running your own marketplace
that you've configured Firefox to look at. I don't know how to do that,
though there do seem to be some docs on it. This seems like somewhat of
a hassle. I should note that when I installed a (normal) app from the
marketplace on linux, A webapprt stub was created that created a
.desktop file in ~/.local/share/applications and a stub under my home
directory at "~/.APPNAME-HASHLOOKINGTHING". This suggests a completely
different codepath is involved and more work is required.
I went looking for bugs but only found fixed bugs. It seems like this
issue may span devtools and multiple groups, so asking someone more
knowledgeable may be the best solution. I'd advise two things:
1) Join the dev-webapps list/group and ask about this
(
https://www.mozilla.org/about/forums/#dev-webapps). I can of course
ask for you, but it's probably beneficial all around if there's some
visibility of your work in there, if only because then Mozilla
evangelism/developer relations/bizdev/webapprt people will see you and
maybe be able to help in ways I could not.
2) A workaround is just to explicitly authorize an origin. You don't
need to package your app either; it can be served via localhost (or
preferably a virtual-homed localhost that is only serving your app code
so it gets its own origin/etc.). See the part of
https://github.com/mozilla-b2g/gaia/blob/master/apps/email/README.md
that discusses "Running in Firefox".
Andrew