背景:反重慶重橙網絡科技有限公司的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並提示用戶安裝後重啓軟件。網絡