A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developer.cdn.mozilla.net/en-US/docs/Web/API/FragmentDirective below:

FragmentDirective - Web APIs | MDN

FragmentDirective

Baseline 2025

Newly available

The FragmentDirective interface is an object exposed to allow code to check whether or not a browser supports text fragments.

It is accessed via the Document.fragmentDirective property.

Instance properties

None.

Instance methods

None.

Examples Checking if text fragments are supported

The code below logs whether or not text fragments are supported in your browser by checking that Document.fragmentDirective is defined. Note that the object is empty, and at present is mainly intended for feature detection. In the future, it might include other information.

const logElement = document.querySelector("#log");
function log(text) {
  logElement.innerText = text;
}
if (document.fragmentDirective) {
  log("Your browser supports text fragments.");
} else {
  log("Text fragments are not supported in your browser.");
}
Specifications Browser compatibility See also

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4