HTML streaming settersLimited availability
The streamHTML(), streamReplaceWithHTML(), streamBeforeHTML(), streamPrependHTML(), streamAppendHTML() and streamAfterHTML() DOM methods, and unsafe equivalents, return writeable streams that incrementally insert HTML into an existing tree.
Not yet supported in all major browsers — check the table and provide a fallback.
Browser support
DesktopChrome
✕Not supportedup to 155
Current: 155Edge
✕Not supportedup to 154
Current: 154Firefox
✕Not supportedup to 157
Current: 157Safari
✕Not supportedup to 27
Current: 27MobileChrome Android
✕Not supportedup to 155
Current: 155Firefox Android
✕Not supportedup to 157
Current: 157Safari iOS
✕Not supportedup to 27
Current: 27How to use
Not supported in Chrome, Edge, Firefox, Safari, Chrome Android, Firefox Android, Safari iOS. Use feature detection below and provide a fallback (or a polyfill) for those browsers.
Example
Full syntax and examples are on MDN: textStream.
Feature detection
JS · check before using
if ("CharacterData" in globalThis && "streamAfterHTML" in CharacterData.prototype) {
// CharacterData.streamAfterHTML is available
}Documentation (MDN)
Specification
Sub-features
Support for each part of the feature (33). The overall table above shows when the whole feature works.
| Sub-feature | Chrome | Edge | Firefox | Safari | Chrome Android | Firefox Android | Safari iOS |
|---|---|---|---|---|---|---|---|
| Blob.textStream | 151 | 151 | ✕ | ✕ | 151 | ✕ | ✕ |
| CharacterData.streamAfterHTML | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ |
| CharacterData.streamAfterHTMLUnsafe | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ |
| CharacterData.streamBeforeHTML | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ |
| CharacterData.streamBeforeHTMLUnsafe | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ |
| CharacterData.streamReplaceWithHTML | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ |
| CharacterData.streamReplaceWithHTMLUnsafe | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ |
| Element.streamAfterHTML | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ |
| Element.streamAfterHTMLUnsafe | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ |
| Element.streamAppendHTML | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ |
| Element.streamAppendHTMLUnsafe | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ |
| Element.streamBeforeHTML | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ |
| Element.streamBeforeHTMLUnsafe | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ |
| Element.streamHTML | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ |
| Element.streamHTMLUnsafe | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ |
| Element.streamPrependHTML | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ |
| Element.streamPrependHTMLUnsafe | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ |
| Element.streamReplaceWithHTML | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ |
| Element.streamReplaceWithHTMLUnsafe | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ |
| Request.textStream | 151 | 151 | ✕ | ✕ | 151 | ✕ | ✕ |
Show 13 more
| Sub-feature | Chrome | Edge | Firefox | Safari | Chrome Android | Firefox Android | Safari iOS |
|---|---|---|---|---|---|---|---|
| Response.textStream | 151 | 151 | ✕ | ✕ | 151 | ✕ | ✕ |
| ShadowRoot.streamAfterHTML | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ |
| ShadowRoot.streamAfterHTMLUnsafe | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ |
| ShadowRoot.streamAppendHTML | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ |
| ShadowRoot.streamAppendHTMLUnsafe | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ |
| ShadowRoot.streamBeforeHTML | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ |
| ShadowRoot.streamBeforeHTMLUnsafe | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ |
| ShadowRoot.streamHTML | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ |
| ShadowRoot.streamHTMLUnsafe | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ |
| ShadowRoot.streamPrependHTML | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ |
| ShadowRoot.streamPrependHTMLUnsafe | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ |
| ShadowRoot.streamReplaceWithHTML | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ |
| ShadowRoot.streamReplaceWithHTMLUnsafe | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ |