Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Detecting the presence of specific extension from javascript

8 views
Skip to first unread message

Mark Miller

unread,
Nov 17, 2006, 5:58:58 PM11/17/06
to dev-ext...@lists.mozilla.org
Hi,

I'm trying to improve the experience that Firefox users have when
they first click a link into the iTunes store. Currently with
Internet Explorer we can autodetect the installation of iTunes by
checking for the presence of a special ActiveX component, but no such
analogue exists for Firefox. You can see this happen here:

http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewTVSeason?
i=203718787&id=204608536&s=143441&nc=1

We'd like to improve on that by including a simple FF extension with
the installer that would be detectable from within javascript- the
javascript could then decide to send the user forward into the store
by launching iTunes, or to redirect the user to an iTunes download page.

Is this possible?

Thanks,

Mark Miller

Nickolay Ponomarev

unread,
Nov 17, 2006, 6:20:05 PM11/17/06
to Mark Miller, dev-ext...@lists.mozilla.org
On 11/18/06, Mark Miller <markm...@apple.com> wrote:
> Hi,
>
> I'm trying to improve the experience that Firefox users have when
> they first click a link into the iTunes store. Currently with
> Internet Explorer we can autodetect the installation of iTunes by
> checking for the presence of a special ActiveX component, but no such
> analogue exists for Firefox.
>
You could use the DOM events to talk to the installed extension, see
http://forums.mozillazine.org/viewtopic.php?p=1005555#1005555 for
description and http://circum.com/startalocalprogram.html for an
example.

It is also possible to make an object accessible to webpage JS via a
global property - see nsSidebar.js - but I consider it less clean.

Nickolay

Philip Chee

unread,
Nov 18, 2006, 10:50:32 AM11/18/06
to
On Fri, 17 Nov 2006 14:58:58 -0800, Mark Miller wrote:

> We'd like to improve on that by including a simple FF extension with
> the installer that would be detectable from within javascript- the
> javascript could then decide to send the user forward into the store
> by launching iTunes, or to redirect the user to an iTunes download page.

You could create a dummy plugin (and install it together with itunes)
which would then be visible via navigator.plugins

<http://developer.mozilla.org/en/docs/navigator.plugins>

Not to mention this url from some obscure hardware company.
<http://developer.apple.com/internet/webcontent/examples/detectplugins_source.html>

Phil
--
Philip Chee <phi...@aleytys.pc.my>, <phili...@gmail.com>
http://flashblock.mozdev.org/ http://xsidebar.mozdev.org
Guard us from the she-wolf and the wolf, and guard us from the thief,
oh Night, and so be good for us to pass.
[ ]Originality is the art of concealing your source...
* TagZilla 0.059

Shawn Wilsher

unread,
Nov 19, 2006, 9:10:24 AM11/19/06
to
Mark,

You could also append a string to the useragent. See
http://www.mozilla.org/build/revised-user-agent-strings.html#implementation
for details.

Cheers,

Shawn

0 new messages