Plugin Detection

by serio

JavaScript

function detectPlugin(name) {
    for (i = 0; i < navigator.plugins.length; i++) {
        p = navigator.plugins[i].name;
        if (p.lastIndexOf(name) != -1) return true;
    };

    return false;
}

console.log(detectPlugin('QuickTime'));
console.log(detectPlugin('Shockwave Flash'));