FragmentDirective
Baseline 2024Newly available
Since October 2024, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.
FragmentDirective
接口是用于特性检测的对象,即用来判断浏览器是否支持文本片段。
可通过 Document.fragmentDirective
属性访问。
实例属性
无。
实例方法
无。
示例
在支持该特性的浏览器中打开一个包含一个或多个匹配的文本片段的标签页,并尝试在其开发者工具中运行以下代码:
js
document.fragmentDirective;
// 如果支持则返回空的 FragmentDirective 对象,否则返回 undefined
此功能目前主要用于特性检测。未来 FragmentDirective
对象可以包含更多信息。
规范
Specification |
---|
URL Fragment Text Directives # fragmentdirective |