Detecting Pepper (PPAPI) Flash with Javascript

后端 未结 5 1294
悲&欢浪女
悲&欢浪女 2021-02-10 21:14

We are using a proprietary document viewer which doesn\'t play terribly nice with the Pepper version of Flash found in some flavors of Chrome, so I\'d like to be able to detect

5条回答
  •  南方客
    南方客 (楼主)
    2021-02-10 22:18

    A version of Darren's check that doesn't require Underscore.js

    var checkForPepper = function() {
    if (navigator.plugins) {
        for (var i=0, count = navigator.plugins.length; i < count; i++) {
            var filename = navigator.plugins[i].filename;
            if (filename === 'pepflashplayer.dll' || filename === 'PepperFlashPlayer.plugin') return true;
        }
    }
    return false;
    

    }

提交回复
热议问题