ActiveX detection - is this possible?

They have: 7 posts

Joined: Jan 2009

Hi can anyone help?

A client of ours is asking us to use a webcam on a site we are developing for them. The code supplied is using the activex/object embed method, not my preferred choice of embedding but its a third party code so we cant alter it.

Dreamweaver has added the usual scripts to the page (AC_ActiveX.js and AC_RunActiveContent.js), which obviously eliminates the need for users to click to activate the content but our client has has asked us whether we can detect to see whether the users browsers have ActiveX installed, and if not, whether we can display alternative content instead.

I must admit, i'm not too clear on how the whole ActiveX thing works so would appreciated it greatly if someone can shed some light on how it works, and if there is indeed some sort of detection method that can display alternative content if the ActiveX content is blocked?

Many thanks in advance

decibel.places's picture

He has: 1,494 posts

Joined: Jun 2008

Perhaps this will help (from a Google search) - original post

Finding out whether an active x is installed is pretty straight forward, you just declare it as per normal and then just check it is present. The snippet below will redirect if MSXML4 is not installed.

Code:

<OBJECT id="MSXML4"
classid="clsid:88d969c0-f192-11d4-a65f-0040963251e5"
codebase="http://www..../msxml4.cab#version=4,10,9404,0"
type="application/x-oleobject"
STYLE="display: none"
standby="ww">
Alternative Text
</OBJECT>

<script>
//if msxml4 is not installed
if( !document.MSXML4 ){
document.loction.href = "SomePage.html"
}
</script>

NOTE: there is an error in the original code, the closing brace at the end was after the closing script tag, I corrected it here Wink

They have: 7 posts

Joined: Jan 2009

Thats great thankyou, i will try this out tomorrow. Just out of interest, do you know whether ActiveX is inherently present in all windows machines?

decibel.places's picture

He has: 1,494 posts

Joined: Jun 2008

Hi vneal,

First of all, welcome to TWF! Laughing out loud

I do not use program with ActiveX - perhaps someone else can answer that.

They have: 7 posts

Joined: Jan 2009

Neither do we normally - despite us advising against using this code because of known cross browser support, the client is insisting we still use it!!
No doubt it will be our fault when he see's for himself that it doesn't work properly lol!
Thanks for your help anyway!

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.