Navigator: presentation 属性
Navigator 的只读属性 presentation 是 Presentation API 的入口点,它返回一个指向 Presentation 对象的引用。
值
指向 Presentation 对象的引用。
示例
当前,navigator.presentation 属性对于功能检查非常有用,并且对于接收用户代理来说,可以访问 PresentationReceiver。
js
// Check if the Presentation API is available in the current browser
if ("presentation" in navigator) {
footer.textContent = navigator.presentation.receiver
? "Receiving presentation"
: "(idle)";
} else {
console.error("Presentation API is not available in this browser.");
}
规范
| 规范 |
|---|
| Presentation API # dom-navigator-presentation |
浏览器兼容性
加载中…