computermaus
computermaus

Reputation: 73

How to detect if a browser addon is installed?

I have written my own addon for Firefox and Chrome. Is there any way to detect if the current user has installed my addon when he comes to my website? I would like to add some extra information for users without my addon when they are visiting me. So far I only found a way to detect plugins

Upvotes: 1

Views: 134

Answers (1)

GibboK
GibboK

Reputation: 73988

You could have your extensions add some hidden div in the dom and check if the div is present example:

var isInstalled = document.documentElement.getAttribute('yourExtension');

if (isInstalled) {
    //...
}

Or alternatively you could consider something like chrome storage, where you can add an object for your extension.

https://developer.chrome.com/extensions/storage

Upvotes: 1

Related Questions