Is it possible to detect that a specific Chrome extension is installed from regular HTML page?

11562 views
Skip to first unread message

Ian Formanek

unread,
Feb 18, 2011, 8:16:29 AM2/18/11
to Chromium-extensions
I would like to be able to check if our "Development support" google
chrome extension is installed from a regular html page displayed in
the browser (to suggest installing it, if not) - is that possible?

-Ian

Ian Formanek

unread,
Feb 21, 2011, 9:21:52 AM2/21/11
to Chromium-extensions

Gildas

unread,
Feb 24, 2011, 2:56:00 PM2/24/11
to Chromium-extensions
You can use an Image object to detect an extension icon. For example,
the function detectExtension above takes 2 parameters :
- the ID of the extension to detect
- the callback function
Callback function will be called with true as first parameter if
chrome-extension://<extension_id>/resources/icon_16.png is found,
false else.

function detectExtension(extensionId, callback) {
var img;
img = new Image();
img.src = "chrome-extension://" + extensionId + "/resources/
icon_16.png";
img.onload = function() {
callback(true);
};
img.onerror = function() {
callback(false);
};

Arne Roomann-Kurrik

unread,
Feb 24, 2011, 3:01:50 PM2/24/11
to Ian Formanek, Chromium-extensions
Typically this kind of thing is done by having the extension insert a special dom node into the page you want to check on.  When the page loads, check for the presence of the node and prompt the user if it doesn't exist.

~Arne



--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To post to this group, send email to chromium-...@chromium.org.
To unsubscribe from this group, send email to chromium-extens...@chromium.org.
For more options, visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/?hl=en.


Or Moushkatel

unread,
Jun 14, 2016, 10:33:10 AM6/14/16
to Chromium-Extensions-Announce
Hi,

I try using your code, and i'm getting

(index):1 Denying load of chrome-extension://aapocclcgogkmnckokdopfmhonfmgoek/resources/icon_16.png. Resources must be listed in the web_accessible_resources manifest key in order to be loaded by pages outside the extension.
undefined
chrome-extension://invalid/:1 GET chrome-extension://invalid/ net::ERR_FAILED

When i'm submitting this in the URL location' i'm getting the image.

Any idea?

Thanks.

PhistucK

unread,
Jun 14, 2016, 11:38:45 AM6/14/16
to Or Moushkatel, Chromium-Extensions-Announce

On Tue, Jun 14, 2016 at 5:33 PM, 'Or Moushkatel' via Chromium-Extensions-Announce <chromium-...@chromium.org> wrote:
Resources must be listed in the web_accessible_resources manifest key in order to be loaded by pages outside the extension.

Have you followed the message you got? Did you add it under web_accessible_resources?​



PhistucK

parthiban dhanapal

unread,
Aug 23, 2018, 6:30:45 AM8/23/18
to Chromium-Extensions-Announce, omous...@pingidentity.com

Then, you expose this file to the web pages with web_accessible_resources manifest key:


 "web_accessible_resources": ["images/Mylogo.png"],


Reply all
Reply to author
Forward
0 new messages