# Detecting programatically installed extensions

**URL:** <https://discourse.mozilla.org/t/detecting-programatically-installed-extensions/97880>\
**Category:** Learn\
**Created:** [June 1, 2022, 10:06am UTC](https://discourse.mozilla.org/t/detecting-programatically-installed-extensions/97880 "2022-06-01T10:06:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheItalianCoder](https://avatars.discourse-cdn.com/v4/letter/t/7ba0ec/32.png) [@TheItalianCoder](https://discourse.mozilla.org/u/TheItalianCoder)\
**Post date:** [June 1, 2022, 10:06am UTC](https://discourse.mozilla.org/t/detecting-programatically-installed-extensions/97880/1 "2022-06-01T10:06:30Z")

</div>

Hi guys!

I’ve wrote this code, because I’d like to check if my user has specific extension installed.

```
let gettingInfo = browser.runtime.getBrowserInfo()
console.log(gettingInfo);

```

And this is my manifest.json (that is included in my html file)

```
{

```

“permissions”: [  
“webRequest”  
],  
“background”: {  
“scripts”: [  
“browser-polyfill.js”  
]  
},

“content\_scripts”: [{  
// …  
“js”: [  
“browser-polyfill.js”  
]  
}]  
}

My problem is that if I run the html file, I’ve got this error:  
browser is not defined  
How I can solve it?  
Thaks

---

<div class="post-metadata">

**Author:** ![justsomeone](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/justsomeone/32/67787_2.png) [@justsomeone](https://discourse.mozilla.org/u/justsomeone)\
**Post date:** [June 1, 2022, 7:40pm UTC](https://discourse.mozilla.org/t/detecting-programatically-installed-extensions/97880/2 "2022-06-01T19:40:50Z")

</div>

hello @TheItalianCoder

i did not used the browser extension api before but `browser` is exist only on the add-ons extension so it get called by extension not by html or normal js code

check this one if you want to learn more about how to develop an extension

> **[Add-ons - Mozilla | MDN](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons)**
>
> Add-ons allow developers to extend and modify the functionality of Firefox. They are written using standard Web technologies - JavaScript, HTML, and CSS - plus some dedicated JavaScript APIs.

hope that help and have a nice day 🙂

---

<div class="post-metadata">

**Author:** ![TheItalianCoder](https://avatars.discourse-cdn.com/v4/letter/t/7ba0ec/32.png) [@TheItalianCoder](https://discourse.mozilla.org/u/TheItalianCoder)\
**Post date:** [June 2, 2022, 8:09am UTC](https://discourse.mozilla.org/t/detecting-programatically-installed-extensions/97880/3 "2022-06-02T08:09:07Z")

</div>

Hello and thanks for the reply.

So, there is no method to check if a user has installed a specific extension, right?

---

<div class="post-metadata">

**Author:** ![justsomeone](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/justsomeone/32/67787_2.png) [@justsomeone](https://discourse.mozilla.org/u/justsomeone)\
**Post date:** [June 2, 2022, 10:48am UTC](https://discourse.mozilla.org/t/detecting-programatically-installed-extensions/97880/4 "2022-06-02T10:48:59Z")

</div>

Hello @TheItalianCoder

you welcome

i meant that `browser` is only available through the extension api

this what i found

> <https://stackoverflow.com/questions/46727370/how-to-check-if-a-firefox-webextension-is-installed-or-not-with-page-javascript>

hope that help and have a nice day 🙂
