The locked
read-only property of the ReadableStream
interface returns whether or not the readable stream is locked to a reader.
Syntax
var locked = readableStream.locked;
Value
A Boolean
indicating whether or not the readable stream is locked.
Examples
const stream = new ReadableStream({
...
});
const reader = stream.getReader();
stream.locked
// should return true, as the stream has been locked to a reader
Specifications
Specification | Status | Comment |
StreamsThe definition of 'locked' in that specification. | Living Standard | Initial definition. |
Browser compatibility
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Update compatibility data on GitHub
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Chrome
Full support 43 |
Edge
Full support 14 |
Firefox Full support 65 Full support 65 Full support 57 Disabled' From version 57: this feature is behind the |
IE
No support No |
Opera
Full support 30 |
Safari
Full support 10.1 |
WebView Android
Full support 43 |
Chrome Android
Full support 43 |
Firefox Android Full support 65 Full support 65 Full support 57 Disabled' From version 57: this feature is behind the |
Opera Android
Full support 30 |
Safari iOS
Full support 10.3 |
Samsung Internet Android
Full support 4.0 |
Legend
- Full support
- Full support
- No support
- No support
- Experimental. Expect behavior to change in the future.'
- Experimental. Expect behavior to change in the future.
- User must explicitly enable this feature.'
- User must explicitly enable this feature.
ReadableStream.locked by Mozilla Contributors is licensed under CC-BY-SA 2.5.