Identify installed extension in google chrome

5

How can I identify that Google Chrome for the user accessing my site has a certain extension installed. For example, if you have the extension of Glogo.com/Itau, etc. ..

I need to check this to display or not a banner for extension installation.

    
asked by anonymous 20.11.2014 / 21:05

2 answers

0

There is a native way of checking in the Chrome documentation, follow the link

link

    
30.06.2015 / 21:17
7

Every extension has an ID and, when installed, a manifest that resides 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 the 404 error is because the extension is not installed.

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

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

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

    
20.11.2014 / 21:26