Skip to content

Commit

Permalink
flashblock detection added, but commented out as its async
Browse files Browse the repository at this point in the history
  • Loading branch information
paulirish committed Feb 11, 2010
1 parent 96f6da9 commit e9fe315
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions modernizr.js
Original file line number Diff line number Diff line change
Expand Up @@ -610,12 +610,23 @@ window.Modernizr = (function(window,doc,undefined){
// in my testing if plugins are disabled this plugins entry isn't availble, so no need to check
// navigator.mimeTypes['application/x-shockwave-flash'].enabledPlugin
tests[flash] = function(){
var bool;
try {
return !!navigator.plugins['Shockwave Flash'] || !!(new ActiveXObject('ShockwaveFlash.ShockwaveFlash'));
bool = !!navigator.plugins['Shockwave Flash'] || !!(new ActiveXObject('ShockwaveFlash.ShockwaveFlash'));
}
catch(e) {
return false;
bool = false;
}
// test for flashblock
/* -moz-binding to flashblock is asynchronous. >:(
if (bool){
var x = doc.createElement('embed');
x.src = flash+'.swf';
docElement.appendChild(x);
bool = !/chrome/.test(getComputedStyle(x,null).getPropertyValue('-moz-binding'))
docElement.removeChild(x);
} */
return bool;
};

// thanks to F1lt3r and lucideer
Expand Down

0 comments on commit e9fe315

Please sign in to comment.