- window作用域
- window.open()
- timeout interval
- 对话框
- location
- slice splice split
- navgator
- 浏览器插件检测方法
- history
window作用域
window.open()
timeout & interval
对话框
location & slice splice split复习
Navigator
此检测插件方法不使用于ie,因为ie不支持Netscape式插件
完整插件检测方法:单插件检测(IE适用)
const hasPlugin = ((name) => {
name = name.toLowerCase()
for (let i = 0; i < navigator.plugins.length; i++) {
if (navigator.plugins[i].name.toLowerCase().indexOf(name) > -1) {
return true
}
}
return false
})
const hasIEPlugin = ((name) => {
try {
new ActiveXObject(name)
return true
} catch (error) {
return false
}
})
const hasFlash = (() => {
let result = hasPlugin('Flash') //检测Flash
if (!result) {
result = hasIEPlugin('ShockwaveFlash.ShockwaveFlash')
}
return result
})
history