跳到主要内容

Web API

共计 124

用户界面

调试

WebAPI中文名称目标对象环境支持接口(Interfaces)/对象类型(types of objects)
Console API调试功能Window、WorkerGlobalScopeWeb、Workerconsole

界面开发

WebAPI中文名称目标对象环境支持接口(Interfaces)/对象类型(types of objects)
User-Agent Client Hints API 🧪用户代理客户端提示Navigator、WorkerNavigatorWeb、WorkerNavigatorUAData、navigator.userAgentDatanavigator.userAgent
Web ComponentsWeb 组件---
UI EventsUI 事件Window、ElementWebUIEvent、FocusEvent、InputEvent、MouseEvent、PointerEvent、WheelEvent、KeyboardEvent、CompositionEvent
Touch events触摸事件ElementWebTouchEvent、Touch、TouchList
Document Object Model (DOM)文档对象模型(DOM)-WebEventTarget、AbortController、AbortSignal、Node、NodeList、NodeIterator、DocumentType、Document、TreeWalker、DocumentFragment、DOMParser、DOMImplementation、Element、Attr、NamedNodeMap、DOMTokenList、CharacterData、Comment、Text、TextEncoder、TextDecoder、DOMException、AbstractRange、Range、StaticRange、DOMPointReadOnly、DOMPoint、DOMRect、Event、CustomEvent、MutationObserver、MutationRecord
HTML DOM API (BOM)HTML DOM-WebWindow、Navigator、History、Location、Navigation...
HTML Drag and Drop APIHTML 拖放-WebDataTransfer、DataTransferItem、DataTransferItemList、DragEvent
SVG APISVG--SVGElement、SVGSVGElement、...
CSS Object Model (CSSOM)CSS 对象模型(CSSOM)-WebStyleSheet、StyleSheetList、...
Houdini APIs--WebWorklet、...
\- CSS Properties and Values APICSS 属性和值-WebCSSPropertyRule
\- CSS Typed Object Model APICSS 类型对象模型-Web-
\- CSS Painting API 🧪CSS 绘制-WebPaintWorkletGlobalScope
CSS Font Loading APICSS 字体加载-Web、WorkerFontFace、FontFaceSet、FontFaceSetLoadEvent
CSS Custom Highlight APICSS 自定义高亮-WebHighlight、HighlightRegistry
Local Font Access API 🧪本地字体资源WindowWebFontData
EditContext API 🧪富文本编辑器-WebEditContext
Attribution Reporting API 🧪广告/归因报告<a><img>script、WindowWeb-
Fenced Frame API 🧪围栏框架<fencedframe>WebFence、FencedFrameConfig、HTMLFencedFrameElement
Invoker Commands API 🧪-<button><dialog>WebCommandEvent
Web Share APIWeb 共享NavigatorWebNavigator.canShare()Navigator.share()

视图

WebAPI中文名称目标对象环境支持接口(Interfaces)/对象类型(types of objects)
Window Controls Overlay API 🧪窗口控制覆盖--WindowControlsOverlay、WindowControlsOverlayGeometryChangeEvent、navigator.windowControlsOverlay
Page Visibility API页面可见性DocumentWeb-
View Transition API视图过渡DocumentWebViewTransition
Visual Viewport API可视视口WindowWebVisualViewport
Intersection Observer API交叉观察器/视口相交情况变化-WebIntersectionObserver、IntersectionObserverEntry
Resize Observer API监视元素的大小更改ElementWebResizeObserver、ResizeObserverEntry
Selection API选择Window、DocumentWebSelection
Presentation API 🧪演示-WebPresentation、PresentationRequest、PresentationAvailability、PresentationConnectionAvailableEvent、PresentationConnection、PresentationConnectionCloseEvent、PresentationReceiver、PresentationConnectionList;navigator.presentation

路由

WebAPI中文名称目标对象环境支持接口(Interfaces)/对象类型(types of objects)
History API历史记录WindowWebHistory、PopStateEvent;history
Navigation API 🧪导航WindowWebNavigation、NavigationActivation、NavigationDestination、NavigationHistoryEntry、NavigationTransition、NavigationCurrentEntryChangeEvent、NavigateEvent;navigation
URL APIURL-Web、WorkerURL、URLSearchParams
URL Fragment Text DirectivesURL 片段文本指令DocumentWebFragmentDirective
URL Pattern API 🧪URL 模式匹配-Web、WorkerURLPattern Experimental

数据通信

WebAPI中文名称目标对象环境支持接口(Interfaces)/对象类型(types of objects)
Broadcast Channel API广播频道-Web、WorkerBroadcastChannel、postMessage()
Channel Messaging API频道消息-Web、WorkerMessageChannel、MessagePort
Beacon API信标fetchXMLHttpRequestWeb、WorkerNavigator.sendBeacon()

数据流

WebAPI中文名称目标对象环境支持接口(Interfaces)/对象类型(types of objects)
Streams API数据流fetchWeb、WorkerReadableStream、ReadableStreamDefaultReader、ReadableStreamDefaultController、WritableStream、WritableStreamDefaultWriter、WritableStreamDefaultController、TransformStream、TransformStreamDefaultController、ByteLengthQueuingStrategy、CountQueuingStrategy、ReadableStreamBYOBReader、ReadableByteStreamController、ReadableStreamBYOBRequest
Compression Streams API压缩流-Web、WorkerCompressionStream、DecompressionStream

网络请求

WebAPI中文名称目标对象环境支持接口(Interfaces)/对象类型(types of objects)
Fetch API获取网络资源Window、WorkerGlobalScopeWeb、Workerfetch()、Request、Headers、Response
XMLHttpRequest API获取网络资源-Web、WorkerFormData、XMLHttpRequest、XMLHttpRequestUpload、ProgressEvent、XMLHttpRequestEventTarget
Idle Detection API 🧪空闲检测-Web、WorkerIdleDetector
Speculation Rules API 🧪推测规则(预取和预渲染)DocumentWeb-
Background Fetch API 🧪后台获取ServiceWorkerGlobalScopeWeb、WorkerBackgroundFetchManager、BackgroundFetchRegistration、BackgroundFetchRecord、BackgroundFetchEvent、BackgroundFetchUpdateUIEvent
Background Synchronization API后台同步ServiceWorkerGlobalScopeWeb、WorkerSyncManager、SyncEvent
Web Periodic Background Synchronization API 🧪Web 定期后台同步ServiceWorkerGlobalScopeWeb、WorkerPeriodicSyncManager、PeriodicSyncEvent

动画

WebAPI中文名称目标对象环境支持接口(Interfaces)/对象类型(types of objects)
Web Animations APIWeb 动画Document、ElementWebAnimation、AnimationTimeline、DocumentTimeline、AnimationEffectTimingProperties、AnimationEffectReadOnly、KeyframeEffect、KeyframeEffectReadOnly

监控与分析

WebAPI中文名称目标对象环境支持接口(Interfaces)/对象类型(types of objects)
Reporting API 🧪报告-Web、WorkerReport、ReportingObserver、ReportBody、CSPViolationReportBody、DeprecationReportBody、InterventionReportBody、SecurityPolicyViolationEvent

性能

WebAPI中文名称目标对象环境支持接口(Interfaces)/对象类型(types of objects)
Performance APIs性能Window、WorkerGlobalScopeWeb、WorkerPerformance、PerformanceObserver、PerformanceObserverEntryList、PerformanceEntry、LargestContentfulPaint、LayoutShift、LayoutShiftAttribution、EventCounts、NotRestoredReasons、NotRestoredReasonDetails、PerformanceElementTiming、PerformanceEventTiming、PerformanceLongTaskTiming、PerformanceLongAnimationFrameTiming、PerformanceMark、PerformanceMeasure、PerformancePaintTiming、PerformanceResourceTiming、PerformanceNavigationTiming、PerformanceScriptTiming、PerformanceServerTiming、TaskAttributionTiming、VisibilityStateEntry
Web Workers API后台线程(专用 worker、共享 worker)-WorkerWorker、WorkerGlobalScope、WorkerLocation、WorkerNavigator、DedicatedWorkerGlobalScope、SharedWorker、SharedWorkerGlobalScope
Service Worker API离线体验Window、WorkerGlobalScope、Navigator、WorkerNavigatorWeb、WorkerCache、CacheStorage、Client、Clients、ExtendableEvent、ExtendableMessageEvent、FetchEvent、NavigationPreloadManager、NotificationEvent、ServiceWorker、ServiceWorkerContainer、ServiceWorkerGlobalScope、MessageEvent、ServiceWorkerRegistration、WindowClient、navigator.serviceWorker

安全

WebAPI中文名称目标对象环境支持接口(Interfaces)/对象类型(types of objects)
Credential Management API凭证管理-WebCredential、CredentialsContainer、FederatedCredential、PasswordCredential、PublicKeyCredential、PasswordCredentialInit、navigator.credentials
Federated Credential Management (FedCM) API 🧪联合凭据管理(FedCM)<iframe>WebIdentityCredential、IdentityProvider、NavigatorLogin;Navigator
Web Authentication APIWeb 身份验证--AuthenticatorAssertionResponse、AuthenticatorAttestationResponse、AuthenticatorResponse、PublicKeyCredential、navigator.managednavigator.loginnavigator.userActivation
WebOTP API一次性口令(one-time password)-WebOTPCredential
Encoding API字符编码文本-Web、WorkerTextDecoder、TextEncoder、TextDecoderStream、TextEncoderStream
Web Crypto APIWeb 加密Window、WorkerGlobalScopeWeb、WorkerCrypto、CryptoKey、CryptoKeyPair、SubtleCrypto...
Trusted Types API受信任的类型,防止客户端 XSS 攻击Window、WorkerGlobalScopeWeb、WorkerTrustedHTML、TrustedScript、TrustedScriptURL、TrustedTypePolicy、TrustedTypePolicyFactory

场景-图形

WebAPI中文名称目标对象环境支持接口(Interfaces)/对象类型(types of objects)
Canvas API画布<canvas>、Window、WorkerGlobalScopeWeb、WorkerCanvasGradient、CanvasPattern、CanvasRenderingContext2D、OffscreenCanvas、OffscreenCanvasRenderingContext2D、ImageBitmap、ImageBitmapRenderingContext、ImageData、Path2D、TextMetrics、HTMLCanvasElement

场景-音视频

WebAPI中文名称目标对象环境支持接口(Interfaces)/对象类型(types of objects)
Web Audio APIWeb 音频<audio><video>WebAudioBuffer、AudioContext、AudioListener、AudioParam、AudioSinkInfo、AudioWorklet、AudioWorkletGlobalScope、AudioWorkletProcessor、BaseAudioContext、OfflineAudioCompletionEvent、OfflineAudioContext、PeriodicWave
Audio Output Devices API 🧪音频输出设备HTMLMediaElementWebnavigator.mediaDevices
Web Speech API语音合成(文本到语音 TTS)和语音识别(异步语音识别)-WebSpeechRecognition、SpeechRecognitionAlternative、SpeechRecognitionError、SpeechRecognitionEvent、SpeechGrammar、SpeechGrammarList、SpeechRecognitionResult、SpeechRecognitionResultList、SpeechSynthesis、SpeechSynthesisErrorEvent、SpeechSynthesisEvent、SpeechSynthesisUtterance、SpeechSynthesisVoice
Media Capabilities API媒体功能Navigator、WorkerNavigatorWeb、WorkerMediaCapabilities、navigator.mediaCapabilities
MediaStream Recording API媒体录制MediaStream、HTMLMediaElement-MediaRecorder、BlobEvent
Remote Playback API远程回放HTMLMediaElementWebRemotePlayback
Picture-in-Picture API画中画<video>WebPictureInPictureWindow、PictureInPictureEvent
Document Picture-in-Picture API 🧪文档画中画WindowWebDocumentPictureInPicture、DocumentPictureInPictureEvent
Media Capture and Streams API (Media Stream)媒体捕捉与媒体流HTMLCanvasElement、HTMLMediaElementWebCanvasCaptureMediaStreamTrack、InputDeviceInfo、MediaDeviceInfo、MediaDevices、MediaStream、MediaStreamTrack、MediaStreamTrackEvent、MediaTrackConstraints、MediaTrackSettings、MediaTrackSupportedConstraints、OverconstrainedError
MediaStream Image Capture API 🧪媒体流图片捕获-WebImageCapture
Insertable Streams for MediaStreamTrack APIMediaStreamTrack 的可插入流-WebMediaStreamTrackGenerator、MediaStreamTrackProcessor
Encrypted Media Extensions API加密媒体扩展HTMLMediaElementWebMediaEncryptedEvent、MediaKeyMessageEvent、MediaKeys、MediaKeySession、MediaKeyStatusMap、MediaKeySystemAccess
Media Session API媒体会话-WebChapterInformation、MediaMetadata、MediaSession;navigator.mediaSession
Media Source API 🧪媒体源HTMLMediaElement、HTMLVideoElementWorkerMediaSource、SourceBuffer、SourceBufferList、VideoPlaybackQuality、MediaSourceHandle
WebVTT APIWeb 视频文本轨格式<track>-VTTCue、VTTRegion、TextTrack、TextTrackList、TextTrackCue、TextTrackCueList、TrackEvent
WebCodecs API视频或音频编辑、视频会议-Web、WorkerAudioDecoder、AudioEncoder、EncodedAudioChunk、AudioData、VideoDecoder、VideoEncoder、EncodedVideoChunk、VideoFrame、VideoColorSpace、ImageDecoder、ImageTrackList、ImageTrack

场景-元宇宙

WebAPI中文名称目标对象环境支持接口(Interfaces)/对象类型(types of objects)
WebGL: 2D and 3D graphics for the webWeb 图形库HTMLCanvasElementWeb、WorkerWebGLRenderingContext、WebGLBuffer、WebGLFramebuffer、WebGLRenderbuffer...
Geometry interfaces几何界面-WebDOMMatrix、DOMMatrixReadOnly、DOMPoint、DOMPointReadOnly、DOMQuad、DOMRect、DOMRectReadOnly
WebXR Device API 🧪虚拟现实设备-Webnavigator.xr

平台

位置

WebAPI中文名称目标对象环境支持接口(Interfaces)/对象类型(types of objects)
Geolocation API地理位置-WebGeolocation、GeolocationPosition、GeolocationCoordinates、GeolocationPositionError、navigator.geolocation

支付

WebAPI中文名称目标对象环境支持接口(Interfaces)/对象类型(types of objects)
Payment Request API支付请求--PaymentAddress、PaymentRequest、PaymentRequestEvent、PaymentRequestUpdateEvent、PaymentMethodChangeEvent、PaymentResponse、MerchantValidationEvent
Payment Handler API 🧪支付处理-Web、WorkerPaymentManager、CanMakePaymentEvent、PaymentRequestEvent

网络

WebAPI中文名称目标对象环境支持接口(Interfaces)/对象类型(types of objects)
WebSocket API--Web、WorkerWebSocket、WebSocketStream、CloseEvent、MessageEvent
WebTransport API---WebTransport、WebTransportBidirectionalStream、WebTransportDatagramDuplexStream、WebTransportError、WebTransportReceiveStream、WebTransportSendStream
WebRTC API---RTCPeerConnection、RTCDataChannel、RTCDataChannelEvent、RTCSessionDescription、RTCStatsReport、RTCIceCandidate、RTCIceTransport、RTCPeerConnectionIceEvent、RTCRtpSender、RTCRtpReceiver、RTCTrackEvent、RTCSctpTransport
Server-sent events--Web、WorkerEventSource

本地存储

WebAPI中文名称目标对象环境支持接口(Interfaces)/对象类型(types of objects)
Storage API存储--StorageManager、navigator.storagenavigator.storageBucketsnavigator.webkitPersistentStoragenavigator.webkitTemporaryStorage
Storage Access API存储访问--StorageAccessHandle
Web Storage APIWeb 存储--Storage、StorageEvent
Shared Storage API 🧪共享存储--SharedStorage、WindowSharedStorage、WorkletSharedStorage、SharedStorageWorklet、SharedStorageWorkletGlobalScope
Cookie Store APICookie 商店--CookieStore Experimental、CookieStoreManager、CookieChangeEvent、ExtendableCookieChangeEvent、navigator.cookieEnabled
IndexedDB API--Web、WorkerIDBFactory、IDBOpenDBRequest、IDBDatabase
Content Index API 🧪内容索引--ContentIndex、ContentIndexEvent

系统-基础

WebAPI中文名称目标对象环境支持接口(Interfaces)/对象类型(types of objects)
Permissions API权限--Permissions、PermissionStatus、navigator.permissions
Launch Handler API 🧪启动处理--LaunchParams、LaunchQueue
Push API推送--PushEvent、PushManager、PushMessageData、PushSubscription、PushSubscriptionOptions
File System API文件系统--FileSystemHandle、FileSystemFileHandle、FileSystemDirectoryHandle、FileSystemSyncAccessHandle、FileSystemWritableFileStream
File and Directory Entries API文件和目录条目--FileSystem、FileSystemEntry、FileSystemFileEntry、FileSystemDirectoryEntry、FileSystemDirectoryReader
File API文件--Blob、File、FileList、FileReader、FileReaderSync
Background Tasks API后台任务 的协同调度--IdleDeadline、requestIdleCallback()cancelIdleCallback()
Prioritized Task Scheduling API优先任务调度--Scheduler、TaskController、TaskSignal、TaskPriorityChangeEvent、navigator.scheduling
Web Serial API 🧪Web 序列号--Serial、SerialPort、navigator.serial

系统-界面

WebAPI中文名称目标对象环境支持接口(Interfaces)/对象类型(types of objects)
Window Management API 🧪窗口管理--ScreenDetails、ScreenDetailed
Badging API应用图标标记--Navigator.setAppBadge()Navigator.clearAppBadge()
Notifications API通知-Web、WorkerNotification、NotificationEvent
Popover API气泡--ToggleEvent
EyeDropper API 🧪吸管/拾色器--EyeDropper
Contact Picker API 🧪联系人选择器--ContactAddress、ContactsManager、navigator.contacts

设备-物理设备

WebAPI中文名称目标对象环境支持接口(Interfaces)/对象类型(types of objects)
Fullscreen API🖥 全屏---
Screen Orientation API屏幕方向--ScreenOrientation
Screen Capture API屏幕捕获--BrowserCaptureMediaStreamTrack、CaptureController、CropTarget、RestrictionTarget
Screen Wake Lock API屏幕唤醒锁--WakeLock、WakeLockSentinel、navigator.wakeLock
Web Locks APIWeb 锁--Lock、LockManager、navigator.locks
Pointer Lock API🖱️ 鼠标锁---
Pointer events鼠标事件--PointerEvent、navigator.maxTouchPoints
Gamepad API🎮 游戏手柄--Gamepad、GamepadButton、GamepadEvent、GamepadHapticActuator、GamepadPose、Navigator.getGamepads()
Keyboard API 🧪⌨️ 键盘--Keyboard、KeyboardLayoutMap、navigator.keyboard
VirtualKeyboard API 🧪⌨️ 虚拟键盘--VirtualKeyboard、navigator.virtualKeyboard
Ink API 🧪🖌️ 墨水笔--Ink、DelegatedInkTrailPresenter、navigator.ink
Barcode Detection API 🧪扫码/条形码检测-Web、WorkerBarcodeDetector
InputDeviceCapabilities API 🧪输入设备--InputDeviceCapabilities
Clipboard API📋 粘贴板--Clipboard、ClipboardEvent、ClipboardItem、navigator.clipboard
Battery Status API🔋 电池--BatteryManager、Navigator.getBattery()
Device Memory API内存--navigator.deviceMemory
Compute Pressure API 🧪CPU--PressureObserver、PressureRecord
WebGPU API 🧪GPU--GPU、GPUAdapter、GPUAdapterInfo、GPUDevice、navigator.gpu
Network Information API网络/Wi-Fi-Web、WorkerNetworkInformation、navigator.connectionnavigator.onLine
Web Bluetooth API 🧪蓝牙--Bluetooth、BluetoothCharacteristicProperties、BluetoothDevice、BluetoothRemoteGATTCharacteristic、BluetoothRemoteGATTDescriptor、BluetoothRemoteGATTServer、BluetoothRemoteGATTService、navigator.bluetooth
Sensor APIs 🧭 传感器(罗盘/加速计/陀螺仪)--AbsoluteOrientationSensor、Accelerometer、AmbientLightSensor、GravitySensor、Gyroscope、LinearAccelerationSensor、Magnetometer、OrientationSensor、RelativeOrientationSensor、Sensor、SensorErrorEvent
Device orientation events设备方向--DeviceMotionEvent、DeviceMotionEventAcceleration、DeviceMotionEventRotationRate、DeviceOrientationEvent
Vibration API📳 震动--Navigator.vibrate()
Web NFC API 🧪NFC--NDEFMessage、NDEFReader、NDEFRecord

设备-主板接口

WebAPI中文名称目标对象环境支持接口(Interfaces)/对象类型(types of objects)
WebUSB API 🧪USB--USB、USBConnectionEvent、USBDevice、USBInTransferResult、USBOutTransferResult、USBIsochronousInTransferPacket、USBIsochronousInTransferResult、USBIsochronousOutTransferPacket、USBIsochronousOutTransferResult、USBConfiguration、USBInterface、USBAlternateInterface、USBEndPoint、navigator.usb
Web MIDI APIMIDI--MIDIInputMap、MIDIOutputMap、MIDIAccess、MIDIPort、MIDIInput、MIDIOutput、MIDIMessageEvent、MIDIConnectionEvent、navigator.webdriver
WebHID API 🧪人机界面设备(Web Human Interface Devices)--HID、HIDDevice、HIDInputReportEvent、HIDConnectionEvent、navigator.hid