# Using new webextension API

**URL:** <https://discourse.mozilla.org/t/using-new-webextension-api/30004>\
**Category:** addons.mozilla.org\
**Created:** [July 9, 2018, 7:40pm UTC](https://discourse.mozilla.org/t/using-new-webextension-api/30004 "2018-07-09T19:40:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lllusion3418](https://avatars.discourse-cdn.com/v4/letter/l/4da419/32.png) [@lllusion3418](https://discourse.mozilla.org/u/lllusion3418)\
**Post date:** [July 9, 2018, 7:40pm UTC](https://discourse.mozilla.org/t/using-new-webextension-api/30004/1 "2018-07-09T19:40:30Z")

</div>

I changed my extension to use a new webextension feature ([bugzilla](https://bugzilla.mozilla.org/show_bug.cgi?id=1419893)) which means that it’s only compatible with Firefox 62 and upwards. I’m now wondering how I’m supposed to publish it since I still want users to be able to easily use the old version.

One way would be to make my extension backwards-compatible, i.e. to fall back to the old behaviour. To implement this I would need some (preferably documented and reliable) way of testing this feature’s availability. Do I test for the Firefox version? If so, how? (I couldn’t find anything) (e: oops, [found it](https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/runtime/getBrowserInfo)) Though I would prefer if this wasn’t necessary.

The other way would be if AMO were to offer the new version only to browsers that actually fulfill the `strict_min_version` requirements and use the old version otherwise (it doesn’t lack any features).

---

<div class="post-metadata">

**Author:** ![jscher2000](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/jscher2000/32/28202_2.png) [@jscher2000](https://discourse.mozilla.org/u/jscher2000)\
**Post date:** [July 10, 2018, 4:38am UTC](https://discourse.mozilla.org/t/using-new-webextension-api/30004/2 "2018-07-10T04:38:47Z")

</div>

What if you branch between your old code and your new code based on the version number you can derive from:

> **[runtime.getBrowserInfo() - Mozilla | MDN](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/runtime/getBrowserInfo)**
>
> Returns information about the browser in which the extension is installed.

_Whoops, just realized you have a parenthetical about that._

Why isn’t that best? You can continue with one sequence of versions rather than potentially having to maintain an ESR-compatible second sequence as you make other improvements.
