Chrome Extension - how to detect whether the extension is already installed?

63 views
Skip to first unread message

Saurav T.

unread,
Mar 14, 2018, 12:12:19 PM3/14/18
to Chromium-Extensions-Announce
I am trying to offer my chrome extension as an inline download. I need to check whether the user already has the extension installed. Trying to have a good customer experience. 

What is the best chrome api to get that info?

Thanks

PhistucK

unread,
Mar 14, 2018, 12:45:23 PM3/14/18
to Saurav T., Chromium-Extensions-Announce
Have a web_accessible_resources entry for a text file or whatever that has the character "1" and use AJAX and the like to fetch it from chrome-extension://extension-id/text.txt and check the response.


PhistucK

--
You received this message because you are subscribed to the Google Groups "Chromium-Extensions-Announce" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extensions+unsub...@chromium.org.
To post to this group, send email to chromium-extensions@chromium.org.
Visit this group at https://groups.google.com/a/chromium.org/group/chromium-extensions/.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/30a00055-a763-4016-865f-e1f5d4ed47f0%40chromium.org.
For more options, visit https://groups.google.com/a/chromium.org/d/optout.

Michael

unread,
Mar 14, 2018, 7:12:53 PM3/14/18
to Chromium-Extensions-Announce
I have the extension write a hidden div to the page, then have a script on your page check for the hidden div's id. If the div is present, the extension is installed. Otherwise, do inline download.

PhistucK

unread,
Mar 15, 2018, 3:40:06 AM3/15/18
to Michael, Chromium-Extensions-Announce
As long as you have a content script anyway, this should be fine, otherwise, it is just wasteful (there are memory implications for having a content script).


PhistucK

--
You received this message because you are subscribed to the Google Groups "Chromium-Extensions-Announce" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extensions+unsub...@chromium.org.
To post to this group, send email to chromium-extensions@chromium.org.
Visit this group at https://groups.google.com/a/chromium.org/group/chromium-extensions/.

John Mark Reyes

unread,
Mar 15, 2018, 4:00:50 AM3/15/18
to PhistucK, Michael, Chromium-Extensions-Announce
Thank you for this reply, also I have a question regarding the content_script. I have the json on the manifest below.
,{
    "matches": ["http://*/*","https://*/*"],
    "all_frames": true,
    "js": ["js/ads.js"]
  }],


on that ads.js, i have a code that sets attribute on yahoo serp and add event listener to each result, where the event is doing xhr on the domain in my manifest permission. Will it violate the single purpose policy? Your reply is highly appreciated. Thank you very much.

On Thu, Mar 15, 2018 at 3:39 PM, PhistucK <phis...@gmail.com> wrote:
As long as you have a content script anyway, this should be fine, otherwise, it is just wasteful (there are memory implications for having a content script).


PhistucK

On Thu, Mar 15, 2018 at 1:12 AM, Michael <mic...@stajer.net> wrote:
I have the extension write a hidden div to the page, then have a script on your page check for the hidden div's id. If the div is present, the extension is installed. Otherwise, do inline download.


On Wednesday, March 14, 2018 at 9:12:19 AM UTC-7, Saurav T. wrote:
I am trying to offer my chrome extension as an inline download. I need to check whether the user already has the extension installed. Trying to have a good customer experience. 

What is the best chrome api to get that info?

Thanks

--
You received this message because you are subscribed to the Google Groups "Chromium-Extensions-Announce" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extensions+unsubscribe...@chromium.org.

--
You received this message because you are subscribed to the Google Groups "Chromium-Extensions-Announce" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extensions+unsub...@chromium.org.
To post to this group, send email to chromium-extensions@chromium.org.
Visit this group at https://groups.google.com/a/chromium.org/group/chromium-extensions/.



--

BeeStripe LLC

John Mark Reyes / Software Engineer
johnmar...@beestripe.com
Skype: beestripe_johnmark

BeeStripe LLC 
http://www.beestripe.com

This e-mail message may contain confidential or legally privileged information and is intended only for the use of the intended recipient(s). Any unauthorized disclosure, dissemination, distribution, copying or the taking of any action in reliance on the information herein is prohibited. E-mails are not secure and cannot be guaranteed to be error free as they can be intercepted, amended, or contain viruses. Anyone who communicates with us by e-mail is deemed to have accepted these risks. BeeStripe LLC is not responsible for errors or omissions in this message and denies any responsibility for any damage arising from the use of e-mail. Any opinion and other statement contained in this message and any attachment are solely those of the author and do not necessarily represent those of the company.

PhistucK

unread,
Mar 15, 2018, 4:06:23 AM3/15/18
to John Mark Reyes, Michael, Chromium-Extensions-Announce
Please, keep the discussion on topic and start new threads for new topics.


PhistucK

Devlin Cronin

unread,
Mar 15, 2018, 10:57:51 AM3/15/18
to Chromium-Extensions-Announce, tapad...@gmail.com
Have a web_accessible_resources entry for a text file or whatever that has the character "1" and use AJAX and the like to fetch it from chrome-extension://extension-id/text.txt and check the response.
Note that this will make your extension fingerprintable by any website, which is generally bad for user privacy.

The most secure way to check if your extension is installed is to attempt to message it. This will ensure that only trusted websites can use this detection, and it will be invisible to other websites (unless it performs some detectable action). 

PhistucK

unread,
Mar 15, 2018, 12:17:19 PM3/15/18
to Devlin Cronin, Chromium-Extensions-Announce, Saurav T.
Right, that is a good way (but you must have an event page or a background page).


PhistucK

On Thu, Mar 15, 2018 at 4:57 PM, Devlin Cronin <rdevlin...@chromium.org> wrote:
Have a web_accessible_resources entry for a text file or whatever that has the character "1" and use AJAX and the like to fetch it from chrome-extension://extension-id/text.txt and check the response.
Note that this will make your extension fingerprintable by any website, which is generally bad for user privacy.

The most secure way to check if your extension is installed is to attempt to message it. This will ensure that only trusted websites can use this detection, and it will be invisible to other websites (unless it performs some detectable action). 

On Wednesday, March 14, 2018 at 9:45:23 AM UTC-7, PhistucK wrote:
Have a web_accessible_resources entry for a text file or whatever that has the character "1" and use AJAX and the like to fetch it from chrome-extension://extension-id/text.txt and check the response.


PhistucK

On Wed, Mar 14, 2018 at 6:12 PM, Saurav T. <tapad...@gmail.com> wrote:
I am trying to offer my chrome extension as an inline download. I need to check whether the user already has the extension installed. Trying to have a good customer experience. 

What is the best chrome api to get that info?

Thanks

--
You received this message because you are subscribed to the Google Groups "Chromium-Extensions-Announce" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extensions+unsubscribe...@chromium.org.

--
You received this message because you are subscribed to the Google Groups "Chromium-Extensions-Announce" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extensions+unsub...@chromium.org.
To post to this group, send email to chromium-extensions@chromium.org.
Visit this group at https://groups.google.com/a/chromium.org/group/chromium-extensions/.
Reply all
Reply to author
Forward
0 new messages