CrashReportContext: initialize() method

Note: This feature is available in Web Workers.

Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The initialize() method of the CrashReportContext interface initializes a portion of memory to be used for storing crash report data specified by set(). This must be called before any other method is invoked on the object.

Syntax

js
initialize(length)

Parameters

length

A number indicating the maximum number of bytes that can be stored in the key-value store by each individual set() call. The maximum allowable value is 65536 (64KB), which is also the maximum amount of crash report memory allowed for one origin.

Return value

A Promise that fulfills with undefined.

Exceptions

InvalidStateError DOMException

Thrown if:

  • The calling document is not fully active.
  • A crash report key-value store was already initialized by a previous initialize() call.
NotAllowedError DOMException

length is more than 65536.

Examples

Basic usage

js
window.crashReport.initialize(1024).then(() => {
  // Do stuff with crash reporting API
});

Specifications

Specification
Crash Reporting
# dom-crashreportcontext-initialize

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
initialize
Experimental
Chrome – Full support
Chrome 145 (Release date: 2026-02-10)
footnote Full support
Edge – Full support
Edge 145 (Release date: 2026-02-14)
footnote Full support
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 129 (Release date: 2026-03-18)
footnote Full support
Safari – No support
Safari
footnote No support
Chrome Android – Full support
Chrome Android 145 (Release date: 2026-02-10)
footnote Full support
Firefox for Android – No support
Firefox for Android
footnote No support
Opera Android – Full support
Opera Android 96 (Release date: 2026-03-10)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – No support
Samsung Internet
footnote No support
WebView Android – Full support
WebView Android 145 (Release date: 2026-02-10)
footnote Full support
WebView on iOS – No support
WebView on iOS
footnote No support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support
Experimental. Expect behavior to change in the future.

See also