This project is archived and is in readonly mode.

#1267 ✓invalid
dbarth

Flash detection // Performance Issue

Reported by dbarth | December 9th, 2011 @ 09:57 AM

The Flash detection should be transformed in an "on-demand" method.

In IE Browsers you lose some seconds on initialization, and you really don't need to do the check by default.

so, here is my proposal:

(function() {

var version;

var detect = function() {
    if (!version) {
        version = (Function.attempt(function(){
            return navigator.plugins['Shockwave Flash'].description;
        }, function(){
            return new ActiveXObject('ShockwaveFlash.ShockwaveFlash').GetVariable('$version');
        }) || '0 r0').match(/\d+/g);
    }
    return version;
}

Browser.Plugins.Flash = {
    version: function () { return Number(detect()[0] || '0.' + detect()[1]) || 0 },
    build: function () { return Number(detect()[2]) || 0}
};

})()

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Shared Ticket Bins

People watching this ticket

Pages