# How to publish my WebExtension my own

**URL:** <https://discourse.mozilla.org/t/how-to-publish-my-webextension-my-own/14226>\
**Category:** Add-on Support\
**Created:** [March 7, 2017, 11:02am UTC](https://discourse.mozilla.org/t/how-to-publish-my-webextension-my-own/14226 "2017-03-07T11:02:22Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![sandeepgarg](https://avatars.discourse-cdn.com/v4/letter/s/50afbb/32.png) [@sandeepgarg](https://discourse.mozilla.org/u/sandeepgarg)\
**Post date:** [March 7, 2017, 11:02am UTC](https://discourse.mozilla.org/t/how-to-publish-my-webextension-my-own/14226/1 "2017-03-07T11:02:22Z")

</div>

Hi,

I want to publish my extension using my own installer. I have my signed xpi file. But how i should install using my installer. Earlier i use to copy my manifest.json and other files to %appdata%/Mozilla\Extensions{ec8030f7-c20a-464f-9b0e-13a3a9e97384} folder. But not sure how to use xpi file now.

Regards,  
Sandeep

---

<div class="post-metadata">

**Author:** ![jerrykrinock](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/jerrykrinock/32/5935_2.png) [@jerrykrinock](https://discourse.mozilla.org/u/jerrykrinock)\
**Post date:** [March 8, 2017, 3:42pm UTC](https://discourse.mozilla.org/t/how-to-publish-my-webextension-my-own/14226/2 "2017-03-08T15:42:52Z")

</div>

Here is how I do it on macOS.

My installer prompts the user to run Firefox in the desired profile, and then click a “OK” button; also it tells the user that after they click the “OK” button, Firefox will activate and prompt them in a popover to install the extension. When they click the “OK” button, my installer “opens” the .xpi file in the currently-running Firefox instance using the macOS [NSWorkspace open(\_:withApplicationAt:options:configuration:)](https://developer.apple.com/reference/appkit/nsworkspace/1528548-open) function. I’m sure that other platforms have a similar API.

It is true that, until 2-3 years ago I just copied the files into place as you did, without even prompting the user, relaunched Firefox, and that worked.

---

<div class="post-metadata">

**Author:** ![sandeepgarg](https://avatars.discourse-cdn.com/v4/letter/s/50afbb/32.png) [@sandeepgarg](https://discourse.mozilla.org/u/sandeepgarg)\
**Post date:** [March 9, 2017, 4:13am UTC](https://discourse.mozilla.org/t/how-to-publish-my-webextension-my-own/14226/3 "2017-03-09T04:13:41Z")

</div>

Is there a way that i can copy my xpi file for WebExtension and once firefox loaded after my installation(msi) and recognize new WebExtension

---

<div class="post-metadata">

**Author:** ![jerrykrinock](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/jerrykrinock/32/5935_2.png) [@jerrykrinock](https://discourse.mozilla.org/u/jerrykrinock)\
**Post date:** [March 9, 2017, 5:29am UTC](https://discourse.mozilla.org/t/how-to-publish-my-webextension-my-own/14226/4 "2017-03-09T05:29:02Z")

</div>

If your installer is a native application, theoretically, yes. Because Firefox is a native application, you could reverse-engineer, and/or study Firefox’ open source code, and spoof whatever Firefox does when the user approves an extension. In addition to copying your files into the profile folder, you will probably need to add objects to the prefs.js file. But there may be more to it than that. And whatever you do would be completely unsupported and subject to breakage in any new Firefox version. Finally, your installer would probably need to first quit Firefox if it is running, before so messing with its files. So if your purpose is to make the installation seamless and unnoticed by the user, you’ll be wasting a lot of development time.

Unless your purpose is a hacking challenge, I recommend instead doing it _above board_, as I described in my original reply 🙂

---

<div class="post-metadata">

**Author:** ![sandeepgarg](https://avatars.discourse-cdn.com/v4/letter/s/50afbb/32.png) [@sandeepgarg](https://discourse.mozilla.org/u/sandeepgarg)\
**Post date:** [March 9, 2017, 5:44am UTC](https://discourse.mozilla.org/t/how-to-publish-my-webextension-my-own/14226/5 "2017-03-09T05:44:55Z")

</div>

I found the solution on following link.

> **[Alternative distribution options](https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Alternative_distribution_options)**
>
> The standard add-on distribution and installation process is through Firefox using a signed XPI file obtained from addons.mozilla.org (AMO) (for listed add-ons) or a download set up by a developer (for unlisted add-ons).

In Firefox 4 you may also just copy the extension’s XPI to the directory and name it .xpi as long as the extension does not require extraction to work correctly. If it needs to be extracted/unpacked then you should find a line in the install.rdf file that defines unpack as true (e.g. em:unpacktrue\</em:unpack\>). All WebExtensions based add-ons do not require being unpacked.

Thanks and Regards,  
Sandeep

---

<div class="post-metadata">

**Author:** ![jerrykrinock](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/jerrykrinock/32/5935_2.png) [@jerrykrinock](https://discourse.mozilla.org/u/jerrykrinock)\
**Post date:** [April 1, 2017, 7:01pm UTC](https://discourse.mozilla.org/t/how-to-publish-my-webextension-my-own/14226/6 "2017-04-01T19:01:57Z")

</div>

Thank you for digging that document up, Sandeep. Obviously, you are correct that this method of installing extensions is currently supported. However, that document was outdated, mixed up due to partial edits, and was missing some important information. After doing some experiments, I edited the document – at least in my opinion, it makes sense now 🙂

Conclusion: There are advantages and drawbacks to this method, compared with the _open the XPI_ method which I described in my previous post. Developers should read and consider which gives a better user experience for their application.

---

<div class="post-metadata">

**Author:** ![andreip](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/andreip/32/24181_2.png) [@andreip](https://discourse.mozilla.org/u/andreip)\
**Post date:** [April 1, 2017, 7:40pm UTC](https://discourse.mozilla.org/t/how-to-publish-my-webextension-my-own/14226/7 "2017-04-01T19:40:09Z")

</div>

> [@jerrykrinock](#):
>
> After doing some experiments, I edited the document – at least in my opinion, it makes sense now 🙂

That is really cool! 😃
