Identify extension installed in google Chrome

Asked

Viewed 1,076 times

5

How can I identify that the Google Chrome of the user who is accessing my site has a certain extension installed. For example, one has the extension of Glogo.com/Itau, etc..

I need to check this to show or not a banner for installation of the extension.

2 answers

7

Every extension has an ID and, when installed, a manifest that stays on the user’s computer.

Just go to the following address:

chrome-extension://ID/manifest.json
<!-- Substitua o "ID" acima pelo da sua aplicação. -->
<!-- Note que ID é um texto bem longo e aleatório, não um número. -->

You can do this with ajax, for example. If error 404 is because the extension is not installed.

A very simple attempt to access the address via Ajax can be made like this:

$.ajax({
    url: "chrome-extension://idnljhnpjegfbcohjhdnhjlnfnffmbnf/manifest.json"
    // A extensão acima é o módulo de proteção do Santander.
});

Since you are the author of your extension, it is up to you to determine your ID. To test this with extensions you haven’t developed, I’ll leave you a hint: go to settings -> extensions and look for the Id’s of the extensions in the source code of the page ;) Then just use the above form to test with the extensions you already have on your machine.

  • To be able to access via ajax the features of the extension you need to give access to the file in the manifest: "web_accessible_resources": [ "manifest.json" ],

0


Browser other questions tagged

You are not signed in. Login or sign up in order to post.