Window,document,location,screen,history,navigator。

方法:Alert(),confirm(),prompt(),open(),close()

补充

补充:BOM(Browser Object Model)核心对象:

  • window :全局对象,代表浏览器窗口,所有全局变量/函数都挂在它上。
  • location :处理 URL 信息(href、protocol、host、pathname、search、hash 等),可跳转。
  • history :操作浏览历史(back、forward、go、pushState、replaceState)。
  • navigator :浏览器信息(userAgent、language、platform、onLine、clipboard、geolocation 等)。
  • screen :屏幕信息(width、height、availWidth、colorDepth 等)。
  • document :DOM 根节点,严格说属于 DOM,但常用与 BOM 一起讨论。
  • frames / self / top :窗口层级关系。

window 常用方法:alert / confirm / prompt、open / close、setTimeout / setInterval、requestAnimationFrame、focus / blur、getComputedStyle、fetch(现代)、scrollTo / scrollBy 等。

来源整理自:vue3js.cn 面试官系列