Document.preferredStyleSheetSet

Obsolete
This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.

The preferredStyleSheetSet property returns the preferred style sheet set as set by the page author.

Syntax

preferredStyleSheetSet = document.preferredStyleSheetSet

On return, preferredStyleSheetSet indicates the author's preferred style sheet set. This is determined from the order of style sheet declarations and the Default-Style HTTP header.

If there isn't a preferred style sheet set defined by the author, the empty string ("") is returned.

Example

if (document.preferredStyleSheetSet) {
  console.log("The preferred style sheet set is: " + document.preferredStyleSheetSet);
} else {
  console.log("There is no preferred style sheet.");
}

Browser compatibility

DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
preferredStyleSheetSet
DeprecatedNon-standard
Chrome Full support 1Edge Full support ≤79Firefox Full support YesIE ? Opera ? Safari ? WebView Android Full support YesChrome Android Full support YesFirefox Android Full support YesOpera Android ? Safari iOS ? Samsung Internet Android Full support Yes

Legend

Full support
Full support
Compatibility unknown
Compatibility unknown
Non-standard. Expect poor cross-browser support.
Non-standard. Expect poor cross-browser support.
Deprecated. Not for use in new websites.
Deprecated. Not for use in new websites.

See also