An end event is fired at an XRSession object when the WebXR session has ended, either because the web application has chosen to stop the session, or because the 用户代理 terminated the session.

冒泡 No
可取消 No
接口 XRSessionEvent
Event handler XRSession.onend

范例

To be informed when a WebXR session comes to an end, you can add a handler to your XRSession instance using addEventListener() ,像这样:

XRSession.addEventListener("end", function(event) {
  /* the session has shut down */
});
					

Alternatively, you can use the XRSession.onend event handler property to establish a handler for the end event:

XRSession.onend = function(event) {
 /* the session has shut down */
}
					

规范

规范 状态 注释
WebXR 设备 API
The definition of 'end event' in that specification.
工作草案 初始定义。

浏览器兼容性

更新 GitHub 上的兼容性数据
桌面 移动
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
end event Chrome 79 Edge 79 Firefox No IE No Opera No Safari No WebView Android No Chrome Android 79 Firefox Android No Opera Android No Safari iOS No Samsung Internet Android 11.2

图例

完整支持

完整支持

不支持

不支持

元数据

  • 最后修改: