← Chrome 148 reference

v148 · dom · removal

Deprecate and remove: non-allowlisted Event interfaces from document.createEvent()

Chrome 148 brings document.createEvent() into alignment with the DOM Standard by throwing NOT_SUPPORTED_ERR for any event interface that is not on the spec's allowlist. Code that passes unsupported interface strings will start seeing errors where it previously got a CustomEvent or a silent fallback.

Breaking change document.createEvent("SomeNonStandardInterface") now throws. Migrate to new CustomEvent(), new Event(), or the appropriate constructor for the specific event type.

at a glance

Shipped inChrome 148
StatusIn developer trial / enabled by default
Standards positionSpec-required change; other browsers already compliant
SpecDOM Standard §document.createEvent()
Blink componentBlink>DOM
ChromeStatus5095987863486464 — Deprecate and remove: non-allowlisted Event interfaces

why it exists

The DOM Standard explicitly lists which event interface names document.createEvent() must accept and requires NOT_SUPPORTED_ERR for everything else. Chrome historically accepted many non-standard strings for legacy compat, silently constructing a CustomEvent. This removal closes that compat gap, matches the behavior of Firefox and Safari, and removes a footgun where code that passes wrong interface names silently "worked" in Chrome but would fail cross-browser.

Interfaces with usage above 0.01% or those deemed difficult to remove immediately remain as deprecation-only (console warning) in this cycle.

Source: chromestatus summary + DOM Standard §3.6.

the allowlist

The DOM Standard allows these event interface strings (case-insensitive):

Allowed stringCreates
"Event", "Events", "HTMLEvents"Event
"CustomEvent"CustomEvent
"UIEvent", "UIEvents"UIEvent
"MouseEvent", "MouseEvents"MouseEvent
"KeyboardEvent", "KeyboardEvents"KeyboardEvent
"TouchEvent"TouchEvent (where supported)
"FocusEvent"FocusEvent
"WheelEvent"WheelEvent
"InputEvent"InputEvent
"CompositionEvent"CompositionEvent
"MutationEvent", "MutationEvents"MutationEvent (deprecated)

All other strings now throw DOMException: NOT_SUPPORTED_ERR.

Source: DOM Standard §document.createEvent().

migration

The modern pattern uses constructors directly and doesn't need createEvent at all:

// Old — may throw in Chrome 148+
const evt = document.createEvent("SomeInterface");
evt.initEvent("click", true, true);
el.dispatchEvent(evt);

// New — use constructors
el.dispatchEvent(new MouseEvent("click", { bubbles: true, cancelable: true }));
el.dispatchEvent(new CustomEvent("my-event", { detail: { foo: "bar" } }));
el.dispatchEvent(new KeyboardEvent("keydown", { key: "Enter", bubbles: true }));

Checking whether your code is affected

// Search your codebase for createEvent calls with non-standard strings:
// grep -r 'createEvent' src/ | grep -v -i
//   'Event\|CustomEvent\|UIEvent\|MouseEvent\|KeyboardEvent\|FocusEvent\|WheelEvent\|InputEvent\|CompositionEvent'

browser support

Chrome148 — throws for non-allowlisted strings
FirefoxAlready spec-compliant
SafariAlready spec-compliant
Source: chromestatus browser views + DOM Standard conformance notes.

see also