Web/API/ReadableStream/locked

From Get docs


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

Update compatibility data on GitHub

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet

locked

Experimental'

Chrome

Full support 43

Edge

Full support 14

Firefox Full support 65


Full support 65


Full support 57

Disabled'

Disabled' From version 57: this feature is behind the dom.streams.enabled preference (needs to be set to true) and the javascript.options.streams preference (needs to be set to true). To change preferences in Firefox, visit about:config.

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'

Disabled' From version 57: this feature is behind the dom.streams.enabled preference (needs to be set to true) and the javascript.options.streams preference (needs to be set to true). To change preferences in Firefox, visit about:config.

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.