How to determine if Flash Player is disabled in the browser using JavaScript?

I know how to determine if a Flash player is installed in a browser. For this, I use the hasFlashPlayerVersion () swfobject function . However, I cannot find the documentation on how to determine if the plug-in is installed and is simply disconnected. I have not seen any documentation in the Flash Player Detection Kit that checks if the plug-in is enabled.

+3
source share
4 answers

You can make a javascript call in invisible swf that interacts with the javascript browser. If a timeout occurs, this is because the browser does not have a flash player installed or the flash player is disabled.

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

I agree with Ape and did something similar a long time ago with a page that said something like "detecting a flash player ..." and waited 20 seconds for the swf file to load and immediately redirect the browser from the page.

If the timer expires (swf never started), it will prompt the user to install Flash.

You could combine this approach with the swfobject hasFlashPlayerVersion () function that you talked about. If they have a flash, but swf never loads, then it's safe to assume that the flash is disabled.

, 3 :

  • :
  • :

:

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

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

var isDisabled = hasFlash && !flashEnabled;

javascript, :

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

swf , :

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

, .

+8

, , ​​ , .

- Flash, , . , "".

0

Source: https://habr.com/ru/post/1752308/


All Articles