plugin detection (already installed or not)

2,135 views
Skip to first unread message

malik usman

unread,
Jul 1, 2010, 6:01:40 AM7/1/10
to Chromium-extensions, malik_u...@hotmail.com
Hi,

i have made a plugin, now i want to integrate it with a website...
The problem is how a browser detects that the plugin is already
installed or not?? is there is anyway we can find this??

Regards

PhistucK

unread,
Jul 1, 2010, 6:21:07 AM7/1/10
to malik usman, Chromium-extensions, malik_u...@hotmail.com
A web page cannot detect that an extension is installed, the extension will have to expose this information itself.

The following can be used to signal the existence of an extension -
- You can create a dummy hidden element in the website called "extension-installed" and put a value there "no". Check every few seconds whether its value has changed.
- You can call in your content script, location.href="javascript:ExtensionIsInstalled()" and have a JavaScript function called "ExtensionIsInstalled" on your website.

☆PhistucK



--
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.


Derek 囧

unread,
Jul 1, 2010, 11:11:29 AM7/1/10
to Chromium-extensions
Here:
Use XMLrequest or something like it to get data from here:
chrome://plugins

On 7月1日, 上午5時21分, PhistucK <phist...@gmail.com> wrote:
> A web page cannot detect that an extension is installed, the extension will
> have to expose this information itself.
>
> The following can be used to signal the existence of an extension -
> - You can create a dummy hidden element in the website called
> "extension-installed" and put a value there "no". Check every few seconds
> whether its value has changed.
> - You can call in your content script,
> location.href="javascript:ExtensionIsInstalled()" and have a JavaScript
> function called "ExtensionIsInstalled" on your website.
>
> ☆PhistucK
>
>
>
> On Thu, Jul 1, 2010 at 13:01, malik usman <malik.usman...@gmail.com> wrote:
> > Hi,
>
> > i have made a plugin, now i want to integrate it with a website...
> > The problem is how a browser detects that the plugin is already
> > installed or not?? is there is anyway we can find this??
>
> > Regards
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Chromium-extensions" group.
> > To post to this group, send email to chromium-extensi...@chromium.org.
> > To unsubscribe from this group, send email to
> > chromium-extensions+unsubscr...@chromium.org<chromium-extensions%2Bunsubscr...@chromium.org>
> > .

PhistucK

unread,
Jul 1, 2010, 2:38:23 PM7/1/10
to Derek 囧, Chromium-extensions
You cannot access internal scheme from web pages (or extensions). If you could, that would pose security risks or privacy risks.
So your suggested (too bad it was not tested before it was posted) does not work.
a = new XMLHttpRequest()
XMLHttpRequest
a.open("GET", "chrome://plugins", false)
undefined
a.send({})
Error: NETWORK_ERR: XMLHttpRequest Exception 101


☆PhistucK


To post to this group, send email to chromium-...@chromium.org.
To unsubscribe from this group, send email to chromium-extens...@chromium.org.

karl

unread,
Jul 1, 2010, 4:06:23 PM7/1/10
to Chromium-extensions


> You cannot access internal scheme from web pages (or extensions). If you
> could, that would pose security risks or privacy risks.
> So your suggested (too bad it was not tested before it was posted) does not
> work.

Firstly: I haven't tried this, but I'm pretty sure you could attempt
to load a resource from the extension if you know the extension guid;

function extensionExists(guid, callback){
var img = new Image();
img.onload = function(){
callback(guid, true);
}
img.onerror = function(){
callback(guid, false);
}
img.src = "chrome-extension://{guid}/icon.png";
}

You'd have to know the guid of the extension in question, and the
location of at least one file, but I think it might work where an XHR
would fail.

PhistucK

unread,
Jul 2, 2010, 10:24:30 AM7/2/10
to karl, Chromium-extensions
That sounds more feasible.
And it seems to work -
a = new Image();a.src = "chrome-extension://nnbmlagghjjcbdhgmkedmbmedengocbn/icon16.gif";
a.width
16
At least by executing it through the Developer Tools, it works.


☆PhistucK



--
Reply all
Reply to author
Forward
0 new messages