happy-dom
21.0.4 · 20 Oct 2026MIT37.7M / weekRepositorynpmAtom feed
13.10.1 is the newest release of 13.x.
In short
1 breaking1 security1 deprecated15 new5 fixed
- Breaking
This is a big release where much of the code has been refactored to improve security and to support the new Browser API. A big release is always a potential risk of bugs, so it makes sense to make this a major release to avoid consumers automatically updating to it.
- Security
This release took some time as I didn't want to release the Browser API without applying security fixes.
- Deprecated
Deprecates "@happy-dom/uncaught-exception-observer" as the functionality is supported by "happy-dom" out of the box now.
Security
5 advisories affect 13.0.0; 20.14.6 fixes the others
- CriticalHappy DOM: VM Context Escape can lead to Remote Code ExecutionGHSA-37j7-fg3j-429f · 10 Oct 2025No fix yet
- Criticalhappy-dom allows for server side code to be executed by a <script> tagGHSA-96g7-g7g9-jxw8 · 6 Nov 2024Fixed in 15.10.2
- HighHappy DOM: SSRF via iframe and link stylesheet when parsing untrusted HTMLGHSA-c8p4-j97h-3vg8 · 28 Oct 2026No fix yet
- HighHappy DOM's fetch credentials include uses page-origin cookies instead of target-origin cookiesGHSA-w4gp-fjgq-3q4g · 29 Mar 2026Fixed in 20.8.9
- ModerateHappy DOM has cookie scope forgery: no DNS-label boundary on Domain= matching , attacker origin sets victim cookiesGHSA-5fpq-26gf-qwcr · 28 Oct 2026Fixed in 20.14.6
Release note
:bomb: Breaking Changes
- Breaking
This is a big release where much of the code has been refactored to improve security and to support the new Browser API. A big release is always a potential risk of bugs, so it makes sense to make this a major release to avoid consumers automatically updating to it.
:art: Features
Adds support for a Browser API similar to Puppeteer and Playwright. With the Browser API, it is for example possible to create new pages and navigate in them. You can read more about it in the Happy DOM Wiki.
Improves security by not exposing sensitive internal logic to scripts running within the Happy DOM Browser.
Improves support for CORS management. It now supports "OPTIONS" requests to detect if the client is allowed to proceed with a cross origin request.
Adds support for HTTP response cache. The cache is in memory, but the plan is to add support for storing it on disk in the future.
Improves support for
XMLHttpRequest. It now supports the GZip, Deflate and Brotli encodings.Adds support for adding a process level error event listener for capturing errors. This is useful when using the Browser API, but will not work in environments such as Jest and Vitest, as it collides with their error listener.
Adds support for
Ẁindow.open().Adds support for
Ẁindow.close(). This function should now be used when tearing down the environment.Improves support for cookies.
Improves support for
HTMLIFrameElement.Changes export of types to use "import type" and "export type" in "index.js". This will allow transpilers/compilers to optimize better.
Adds support for navigating when clicking on an anchor link.
Adds support for navigating when setting
Location.href.Improves support for
MutationObserver. It will now queue multiple records by using a microtask. It now also supportsMutationObserver.takeRecords()for records that has not yet been published.- Deprecated
Deprecates "@happy-dom/uncaught-exception-observer" as the functionality is supported by "happy-dom" out of the box now.
Changes internal properties to use
Symbolinstead of using "_" as a prefix, so they won't be enumerable. This will also make sure that these properties won't clash with properties defined by the consumer. It will use private properties with#where it is possible.
:construction_worker_man: Patch fixes
Improves the check for if the property is a class to avoid that it gets bound in "@happy-dom/global-registrator". We only want functions to get bound to the global context.
Fixes bug where
new Document()didn't work according to spec.Fixes bug where several Element classes wheren't available as properties on
Window.Fixes bug in
Document.importNode()where it didn't changeownerDocumenton child nodes.Resets static
ownerDocumentstate used when creating Node instances, so that it can be garbage collected if not used anymore.
Merry Christmas and a Happy New Year! :santa: :sparkles:
This release took some time as I didn't want to release the Browser API without applying security fixes. I've also stumbled across a few other issues along the way that I felt I needed to address.
Thank you everybody for the support! It is nice to see that so many people contribute to the project by reporting issues and doing code fixes.
I think that 2024 will be a fantastic year for Happy DOM with a lot of features and fixes bringing Happy DOM closer and closer to a "real" browser.
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.