clone() method of the
Request interface creates a copy of the current
var newRequest = request.clone();
Request object, which is an exact copy of the
clone() was called on.
In the following snippet, we create a new request using the
constructor (for an image file in the same directory as the script), then clone the request.
var myRequest = new Request('flowers.jpg'); var newRequest = myRequest.clone(); // a copy of the request is now stored in newRequest
The definition of 'clone' in that specification.
|Living Standard||Initial definition|
|Feature||Android webview||Chrome for Android||Edge mobile||Firefox for Android||Opera Android||iOS Safari||Samsung Internet|
1. From version 41: this feature is behind the
Experimental Web Platform Features preference. To change preferences in Chrome, visit chrome://flags.
2. From version 34: this feature is behind the
dom.fetch.enabled preference. To change preferences in Firefox, visit about:config.
3. From version 28: this feature is behind the
Experimental Web Platform Features preference.