3

I know how to detect if Flash player is installed in a browser. I'm using the hasFlashPlayerVersion() function of swfobject for that. However, I can't seem to find any documentation on how to detect if the plug-in is installed and just disabled. I didn't see any documentation in the Flash Player Detection Kit that checks if the plug-in is enabled either.

4 Answers 4

9
+50

I agree with Ape and have done something similar a LONG time ago with a page that said something like "detecting flash player..." and waited 20 seconds while a swf file would load and immediately redirect the browser off the page.

If the timer expired (the swf never loaded), it would prompt the user to install Flash.

It would be possible to combine that approach with the swfobject hasFlashPlayerVersion() function you mentioned. If they have flash but the swf never loads, then it's fairly safe to assume that flash is disabled.

So, there's really only 3 options:

  • No Flash
  • Flash: Enabled
  • Flash: Disabled

In pseudo code, that could look like the following:

var hasFlash = detectFlashPlayerInstalled();
var flashEnabled = false;

/* attempt to load the swf file then wait for some time, then... */

var isDisabled = hasFlash && !flashEnabled;

That works along with javascript functions like:

function flashAlive() {
    flashEnabled = true;
}
function detectFlashPlayerInstalled() { 
    //TODO: detect flash in a better way, this will do for now
    return swfobject.hasFlashPlayerVersion(VERSION);
}

called from a tiny swf file containing:

getURL("javascript:flashAlive();");

I hope that helps in some way.

Sign up to request clarification or add additional context in comments.

3 Comments

swfobject.hasFlashPlayerVersion(VERSION) will return false in both cases: No Flash and Flash: Disabled. So you can't differentiate these two states.
in my Firefox 3.6.18, strangely enough, swfobject.hasFlashPlayerVersion(VERSION) returned same result when flash was installed+enabled and when flash was installed+disabled
@NirO. That's not strange at all, in either case you do indeed have that version installed. Enabled vs. disabled is a different scenario to detect, and the exact reason for this SO question.
0

You could make a javascript call in an invisible swf that communicates with the browser's javascript. If a timeout occurs, then it is because the browser does not have flash player installed, or the flash player has been disabled.

getURL("javascript:jsfunction();");

2 Comments

That's silly, if the browser has flash disabled, it wouldn't even load the "invisible swf".
This would thus cause a timeout to occur in the javascript code waiting for the response from the invisible swf.
0

Here is a nice library I'm using: http://www.featureblend.com/javascript-flash-detection-library.html

Comments

0

I don't think it is possible to detect if flash is installed but disabled.

If someone disables Flash, they might not want to tell if it's just disabled or not installed at all. Therefore a browser just tells you it is 'not available'.

1 Comment

I can't think of a reason to hide this information from a webpage. one reason why this information is important, it could use to display alternate content, for example I allow uploading files in my site using uploadify, but I would like to allow html-form upload if flash is disabled

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.