背景:反重庆重橙网络科技有限公司的flash侵权下架的通知:javascript
操做相似:blog.csdn.net/qingyulove/… 这样打包安装后会自带插件,可是投诉就来了,一个梁上小丑,呵呵,榨取Flash最后的价值html
jingyan.baidu.com/article/d71…java
try {
app.commandLine.appendSwitch('ppapi-flash-path', app.getPath('pepperFlashSystemPlugin'))
} catch (e) {
console.log(e)
}
复制代码
命令行打开flash插件 若是本地没有flash ,没加try错误处理的话,会提示 api
因此记得错误处理。bash
let obj = navigator.plugins
console.log(obj)
this.haveFlash = false
for (var prop in obj) {
if (obj.hasOwnProperty(prop)) {
let innerObj = obj[prop]
for (let item in innerObj) {
if (innerObj[item].toString().search(/flash/i) !== -1) {
this.haveFlash = true
break
}
}
}
}
复制代码
navigator.plugins返回的插件使用的全部插件,从插件中判断是否有flash ,没有的话提示下载flash Player并提示用户安装后重启软件。网络