The destination read-only property of the Request interface returns a string describing the type of content being requested. The string must be one of those found in the RequestDestination enumerated type or the empty string, which is the default value.

The destination is used by the user agent to, for example, help determine which set of rules to follow for CORS purposes, or how to navigate any complicated code paths that affect how specific types of request get handled.


var destination = request.destination;


A string from the RequestDestination enumerated type which indicates the type of content the request is asking for. This type is much broader than the usual document type values (such as "document" or "manifest"), and may include contextual cues such as "image" or "worker" or "audioworklet".


In the following snippet, we create a new request using the Request.Request() constructor (for an image file in the same directory as the script), then save the request's destination:

var myRequest = new Request('flowers.jpg');
var myDestination = myRequest.destination; // returns the empty string by default


Specification Status Comment
The definition of 'destination' in that specification.
Living Standard Initial definition

Browser compatibility

FeatureChromeEdgeFirefoxInternet ExplorerOperaSafari
Basic support651461 No52 No
FeatureAndroid webviewChrome for AndroidEdge mobileFirefox for AndroidOpera AndroidiOS SafariSamsung Internet
Basic support ?65 ?6152 No ?

See also

Document Tags and Contributors

Contributors to this page: ExE-Boss, Sheppy
Last updated by: ExE-Boss,