I'm working on a flash player game which runs on Facebook. I'm trying to detect if the client browser have flash player plugin installed using the swfobject.js (version2.2). I game runs inside an iframe on facebook. Here's my code snippet :
<iframe src='....'>
//content inside the iframe
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>
<script type="text/javascript">
var playerVersion = swfobject.getFlashPlayerVersion();
if(playerVersion.major >= 14) {
swfobject.embedSWF(......); //code for loading swf object
}else{
document.write("<a href='https://www.adobe.com/go/getflashplayer' alt='To view this page ensure that Adobe Flash Player version 14 is installed. Get Adobe Flash player.' id='installFlashContent'></a>");
}
</script>
.....
</iframe>
The swfobject.getFlashPlayerVersion() - this is returning me 0, even if i have flash player plugin installed on my firefox browser.
If the directly open my iframe (Right click > This Frame > Open Frame in New Tab), then the flash player is getting detected correctly as:
{
major : 28
minor : 0
release : 0
}
Digging more into the code, I found that the navigator.plugins.length inside swfobject.js is returning me 0, when i run my code on Facebook.
Any ideas on this? Thank you in advance.
After trying a lot of things, I finally figured out, that the issue is due to firefox browser blocking several websites from loading flash contents inside an iframe(3rd party plugin). We were loading flash contents from cloudfront.net, which is listed in the blocked list of firefox.
Here's the complete list of websites which firefox blocks : Firefox plugin blocklist
More information about this can be found here : Blocking By Domain