HTMLLinkElement: crossOrigin property

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since April 2018.

The crossOrigin property of the HTMLLinkElement interface specifies the Cross-Origin Resource Sharing (CORS) setting to use when retrieving the resource.

Value

A string of a keyword specifying the CORS mode to use when fetching the resource. Possible values are:

anonymous or the empty string ("")

Requests sent by the HTMLLinkElement will use the cors mode and the same-origin credentials mode. This means that CORS is enabled and credentials are sent if the resource is fetched from the same origin from which the document was loaded.

use-credentials

Requests sent by the HTMLLinkElement will use the cors mode and the include credentials mode. All resources requests by the element will use CORS, regardless of what domain the fetch is from.

If the crossOrigin property is specified with any other value, it is the same as specifying as the anonymous.

If the crossOrigin property is not specified, the resource is fetched without CORS (the no-cors mode and the same-origin credentials mode).

Specifications

Specification
HTML
# dom-link-crossorigin

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
crossOrigin
Chrome – Full support
Chrome 34 (Release date: 2014-04-08)
footnote Full support
Edge – Full support
Edge 17 (Release date: 2018-04-30)
footnote Full support
Firefox – Full support
Firefox 18 (Release date: 2013-01-08)
footnote Full support
Opera – Full support
Opera 21 (Release date: 2014-05-06)
footnote Full support
Safari – Full support
Safari 10 (Release date: 2016-09-20)
footnote Full support
Chrome Android – Full support
Chrome Android 34 (Release date: 2014-04-02)
footnote Full support
Firefox for Android – Full support
Firefox for Android 18 (Release date: 2013-01-08)
footnote Full support
Opera Android – Full support
Opera Android 21 (Release date: 2014-04-22)
footnote Full support
Safari on iOS – Full support
Safari on iOS 10 (Release date: 2016-09-13)
footnote Full support
Samsung Internet – Full support
Samsung Internet 2 (Release date: 2014-10-17)
footnote Full support
WebView Android – Full support
WebView Android 37 (Release date: 2014-09-03)
footnote Full support
WebView on iOS – Full support
WebView on iOS 10 (Release date: 2016-09-13)
footnote Full support

Legend

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

Full support
Full support

See also