Document:fragmentDirective 属性

实验性: 这是一项实验性技术
在将其用于生产之前,请仔细检查浏览器兼容性表格

Document 接口的 fragmentDirective 只读属性返回当前文档的 FragmentDirective

示例

在支持该特性的浏览器中打开一个包含一个或多个匹配的文本片段的标签页,并尝试在其开发者工具中运行以下代码:

js
document.fragmentDirective;
// 如果支持则返回空的 FragmentDirective 对象,否则返回 undefined

此功能目前主要用于特性检测。未来 FragmentDirective 对象可以包含更多信息。

规范

Specification
URL Fragment Text Directives
# dom-document-fragmentdirective

浏览器兼容性

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
fragmentDirective

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support
See implementation notes.

参见