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 set() method of the CrashReportContext interface stores a key-value pair in the memory initialized by initialize().
set(key, value)keyA string representing the key of the key-value pair to be stored.
valueA string representing the value of the key-value pair to be stored.
None (undefined).
InvalidStateError DOMExceptionThrown if:
initialize() call.NotAllowedError DOMExceptionThe size of the serialized key-value pair is greater than the length value set when the store was first initialized.
window.crashReport.initialize(1024).then(() => {
// Set a possible crash-causing value, and try
// running an operation that may cause a crash
window.crashReport.set("crash-arg", "00031");
operationThatMightCrash("00031");
// Delete the key-value pair if it doesn't cause a crash
window.crashReport.delete("crash-arg");
});