npm / @happy-dom/global-registrator
@happy-dom/global-registrator
What changed in @happy-dom/global-registrator 20 to 21, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-18.
4 breaking5 security1 deprecations17 new APIs and options8 performance9 behavior and defaults65 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli init@happy-dom/global-registrator 213 changes
Breaking changes 1
CSS and IFrame loading are disabled by default to prevent server-side request forgery from untrusted HTML.
Security 1
Fixes a security vulnerability where the authorization header was forwarded when redirecting.
Deprecations 1
The settings property disableCSSFileLoading has been deprecated.
@happy-dom/global-registrator 20106 changes
Breaking changes 3
Cookies from the current origin are no longer forwarded to the target origin in fetch requests.
Throws an error if the event passed to EventTarget.dispatchEvent() is not of type Event.
The inert attribute now blocks focus interactions.
Security 4
Fixes a cookie scope forgery vulnerability.
Values pushed or assigned to the adoptedStyleSheet array are validated.
Fixes executable-code interpolation in ESM export names that could allow escaping the VM context and accessing process-level functionality in unsafe CommonJS environments.
EventTarget no longer calls arbitrary on* properties.
New APIs and options 17
Adds support for the :host pseudo query selector.
Adds support for Animation.
Adds support for AnimationTimeline.
Adds support for DocumentTimeline.
Adds support for Element.animate().
Adds support for KeyframeEffect.
Allows specifying an explicit element type for querySelector results, such as HTMLInputElement.
Adds support for event listener properties on Window, such as Window.onkeydown.
Adds support for hasPointerCapture to Element.
Adds support for releasePointerCapture to Element.
Adds support for setPointerCapture to Element.
Adds support for Window.getScreenDetails().
Adds support for registering globals when importing the package.
Implements the Text.wholeText property.
Adds the which property to KeyboardEvent.
Adds support for CloseEvent, making it available to developers using Happy DOM.
Adds support for WebSocket, making it available to developers using Happy DOM.
Performance 8
The computed style cache is improved, which may improve performance.
Query selector performance is improved by avoiding DOMException construction when it is not needed.
Adds a cache to mitigate the selector parser's performance degradation introduced in v20.6.3.
Adds support for caching compiled EcmaScript module code.
Improves how nodes are destroyed and garbage collected.
Adding and removing tokens is optimized with a Set.
Query selectors use Element.classList.contains() instead of splitting className, improving performance because classList is cached.
Avoids sorting in querySelector() to improve performance.
Behavior and default changes 9
Adds support for kebab-case properties on CSSStyleDeclaration.
Adds support for all Chromium CSS properties to CSSStyleDeclaration.
Adds support for loading image data URLs.
Screen now extends EventTarget.
The query selector parser can handle complex rules.
CSS gradients now support rgba().
HTML/XML encoding and decoding now uses the entities package.
Elements are upgraded to custom elements only when they are in the document, which also improves memory footprint by allowing nodes to be garbage collected before the document is closed.
Workers in @happy-dom/server-renderer now use the frozen intrinsics flag.
Fixes and other changes 65
Character references are preserved in comment data.
End comments at the first comment end tag when it overlaps a comment start tag.
Fixes a regression where not all CSS variables were resolved in getComputedStyle().
Invalidates the computed style cache for the whole subtree.
Fixes getComputedStyle with :host and :host-context selectors.
GetComputedStyle now returns the inherited value when a property is set to inherit.
Custom elements are upgraded when connected to the DOM.
Fixes issue with parsing CSS fallback variables.
Fixes an issue with upgrading custom elements caused by the previous release.
Upgrading an element changes its prototype to the custom element, keeping references to the original element valid.
Event listeners are copied when upgrading a custom element.
Adds a check that a node is still a parent during disconnect.
Returns the default validationMessage for built-in constraint violations.
Ensures an element has been upgraded before invoking its reaction callback.
Document.adoptedStyleSheets and ShadowRoot.adoptedStyleSheets now validate their value.
The CORS check in fetch() now matches origins instead of host and protocol.
document.links now returns a live HTMLCollection.
Copies the labels array to prevent mutation of a cached querySelectorAll result.
Fixes the callback being garbage-collected due to an orphaned WeakRef.
Awaits the NodeJS internal ReadableStream promise during teardown.
A null qualifiedName is coerced to an empty string in createDocument.
Fixes attribute selector matching for hyphenated substrings in CSS selectors.
Replaces implementation of Node.js Console with the common IConsole interface to support the latest version of Bun.
Request.formData() now honors the Content-Type header.
Fixes an error thrown when modifying DOM structure in connectedCallback().
Calling Event.initEvent() resets Event.cancelBubble and Event.defaultPrevented.
CSS escape sequences in attribute selector values are now properly decoded.
Fixes parsing of direct descendant (>) and universal (*) query selectors.
Adds clearImmediate to the Jest environment's global scope.
Invalid input type attributes are normalized to text per the HTML specification.
Fixes query selectors for attributes in XML documents.
Fixes attribute query selectors with quotes inside quoted values.
Resolves a missing export affecting Vue and vue-compat v3.5.
Selectors now support unicode characters per the CSS spec.
Corrects the caption element content model to allow flow content.
Node.replaceWith no longer throws when called without a parent.
Fixed logic to make HTMLInputElement.stepDown() work according to spec.
Fixed logic to make HTMLInputElement.stepUp() work according to spec.
Selection API now accepts Document nodes as valid boundary points.
Fixed the getters for focusNode and focusOffset, which returned incorrect values.
Fixes toggling the open attribute of <details> by clicking a child of <summary>.
Checks whether hostname and pathname are undefined using optional chaining.
Preserves attribute name case in CSS selectors for XML documents.
Implements implicit closing of <p> elements per the HTML spec.
Parses the Cache-Control header max-age value with parseFloat().
Fixes Node.contains() for <select> and <form> elements.
Returns the correct root for detached shadow trees.
Named HTML entities are decoded correctly.
WebSocket URLs can include paths.
Normalizes the format parameter according to the HTML specification.
Handles partial responses.
Fixes caching in querySelector().
Manually set authorization headers are now included in requests; headers are omitted only when automatically set by page context.
Closing a Window now clears event listeners on all nodes to prevent memory leaks.
nextSibling() now works in HTMLSelectElement and HTMLFormElement.
previousSibling() now works in HTMLSelectElement and HTMLFormElement.
Parsing an item without a permitted parent, such as <tr>, is valid inside a <template> element.
Fixes incorrect handling of the >= operator in the media query parser.
Changes the implementation to be spec compliant.
Changes the implementation to be spec compliant.
Changes the implementation to be spec compliant.
The setter now validates that the value is a Node.
Buttons are added to FormData only if they are the submitter.
CSS variables are now parsed correctly when they appear inside CSS functions.
URL resolution now occurs after checking whether module preloading is enabled, preventing URL errors when a URL cannot be resolved.