跳到主要内容

浏览器兼容

specChromeSafariNodeJSSpec
container-queryChrome 105
window.navigationChrome 102WICG/navigation-api
HTMLInputElement.showPicker()Chrome 99Safari 16
structuredCloneChrome 98Safari 15.4NodeJS 17
CSS ModuleChrome 93
JSON ModuleChrome 91
import mapChrome 89
globalThisChrome 71Safari 12.1NodeJS 12
AbortControllerChrome 66Safari 12.1
overscroll-behaviorChrome 63Safari 16+
dynamic-importChrome 63Safari 11.1
BroadcastChannelChrome 54Safari 15.4
Proxy+ReflectChrome 49Safari 10
<dialog>Chrome 37Safari 15.4
<datalist>Chrome 20Safari 12.1
  • window.navigation
    • 类似于 remix-run/history
    • 接口比 window.history 友好的多
    • navigateEvent.intercept
    • navigateEvent.signal
  • structuredclone
    • 支持 Array, Map, Set, Date, RegExp, ArrayBuffer, Blob, File, FileList, TypedArray, ImageBitmap, Image Data, Error
    • 支持 循环引用
  • Reflect.getMetadata - 需要额外 import
  • HTMLInputElement.showPicker()
  • <datalist>
    • 为 input 提供预设选项
    • 例如: color, text, time, range
  • <fieldset>
    • 可以用来一下子 disabled 一组 input
    • 可以不在 form 内,提供 form id
  • <input>
    • 默认 text
    • button, checkbox, color, date, datetime-local, email file, hidden, image, month, number, password, radio, range. reset, search, submit, tel, text, time, url, week
    • image: 图像 submit 按钮
    • 可以不在 form 内,提供 form id
    • list -> datalist
const structuredClone = globalThis.structuredClone ?? (v)=>JSON.parse(JSON.stringify(v))