Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to detect Flash blockers?

I'm wondering wether there's a Javascript way to detect wether a user has any sort of flash blocking plugin installed so i can accommodate these users properly.

For example, I use 'click to flash', but sites that use SiFR to render text are littered with "click to flash" buttons, which is getting very annoying. I don't use SiFR in my designs for this reason. But if I could spot wether there's a flash blocking plugin installed, I would simply not call the SiFR function.

Any ideas?

like image 992
gargantuan Avatar asked Feb 03 '10 13:02

gargantuan


People also ask

Can you block USB ports?

Enable or Disable Usb Ports Through Device Manager Right-click on the “Start” button on the taskbar and select “Device Manager”. Expand USB Controllers. Right-click on all entries, one after another, and click “Disable Device”. Click “Yes” when you see a confirmation dialog.

Why do we block USB ports?

Protect Endpoints Against USB Malware USB devices can unknowingly infect company computers with ransomware and other malicious software. Disabling USB ports protects endpoints against rogue USB devices by proactively preventing the transmission of malicious files.


2 Answers

Take a look at http://www.adobe.com/support/flash/publishexport/scriptingwithflash/scriptingwithflash_03.html. You could call the following after the page has loaded.

var movie = window.document.movie;
try {
    //if the movie is blocked then PercentLoaded() should through an exception
    if (movie.PercentLoaded() > 0) {
        //Movie loaded or is loading
    }
}
catch (e) {
    //Movie is blocked
}
like image 128
Nathan Villaescusa Avatar answered Sep 28 '22 00:09

Nathan Villaescusa


The soundmanager2 JS library uses the PercentLoaded function of a movie reference.
Excerpt:

return (flash && 'PercentLoaded' in flash ? flash.PercentLoaded() : null);

Interesting syntax notes… Flash/ExternalInterface (ActiveX/NPAPI) bridge methods are not typeof “function” nor instanceof Function, but are still valid. Additionally, JSLint dislikes (‘PercentLoaded’ in flash)-style syntax and recommends hasOwnProperty(), which does not work in this case. Furthermore, using (flash && flash.PercentLoaded) causes IE to throw “object doesn’t support this property or method”. Thus, ‘in’ syntax must be used.

For getting a reference to a Flash movie, this page might prove useful.

like image 23
Protector one Avatar answered Sep 28 '22 01:09

Protector one