BOM

BOM(Browser Object Model)

如何识别浏览器的类型

分析拆解url各个部分

知识点
navigator

//navigator
const ua=navigator.userAgent
const isChrome =ua.indexOf('Chrome');
console.log(isChrome)

screen

screen.width
screen.height

location

console.log(location.href)
console.log(location.protocol)
console.log(location.host)
console.log(location.search)
console.log(location.hash)
console.log(location.pathname)

history

history.back()
history.forward()