Detecting programatically installed extensions

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

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

hope that help and have a nice day :slight_smile:

Hello and thanks for the reply.

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

Hello @TheItalianCoder

you welcome

i meant that browser is only available through the extension api

this what i found

hope that help and have a nice day :slight_smile: