jsdom
31.0.1 · 13 Nov 2026MIT166.8M / weekRepositoryHomepagenpmAtom feed
Upgrading jsdom From 5.0.1 to 5.6.1
10 releases in betweenevery note read
Release by release
- Fixed
Fixed an accidentally-created global
attributevariable if you ever calledcreateAttributeNS. - Fixed
Parsing of CSS properties that use
url("quoted string")now works correctly, as ofcssstylev0.2.29. - Fixed
Selectors for the empty string, like
div[title=""], now work correctly, as ofnwmatcherv1.3.6.
- Fixed
5.6.0nothing new or fixed in the note
- New
Added
postMessagesupport, for communicating between parent windows, iframes, and combinations thereof. It's missing a few semantics, especially around origins, as well as MessageEvent source. Objects are not yet structured cloned, but instead passed by reference. But it's working, and awesome! - Fixed
Elements with weird tag names, of the type that only the parser can normally create, can now be cloned
- Fixed
Doctypes can now be cloned, per the latest spec.
- Fixed
Attrs cannot be cloned, per the latest spec (although they still have a
cloneNodemethod for now due to legacy).
- New
5.4.3nothing new or fixed in the note
- Fixed
Fixed license metadata to conform to latest npm standards.
- Fixed
- Fixed
Fixed to work with browserify again (regression introduced in v5.4.0).
- Fixed
- New
Added support for the default HTML stylesheet when using
window.getComputedStyle! - New
Added support for named properties on
window: any elements with anidattribute, or certain elements with anameattribute, will cause properties to show up on thewindow, and thus as global variables within the jsdom. - New
Implemented the
NonDocumentTypeChildNodemixin. Practically, this means addingnextElementSiblingandpreviousElementSiblingtoElementand the various types ofCharacterData. - Fixed
Fixed an unfortunate bug where
getElementByIdwould fail to work correctly on<img>elements whoseidattributes were modified. - Fixed
Fixed the
virtualConsoleoption to work withjsdom.env, not justjsdom.jsdom.
- New
- New
Added a
virtualConsoleoption to the document creation methods, along with thejsdom.createVirtualConsolefactory. (See examples in the readme.) With this option you can install a virtual console before the document is even created, thus allowing you to catch any virtual console events that occur during initialization.
- New
8 other lines we could not sort, mostly version bumps
- 5.6.0
virtualConsole.sendTonow returnsthis, allowing for a nice shorthand. - 5.4.3
Incorporated upstream fix for setting
el.style.cssTextto an invalid value, which should be ignored instead of causing an error to be thrown. This same bug has also caused an error while setting the style attribute to an invalid value, ever since 5.4.0. (Joris-van-der-Wel; chad3814 upstream) - 5.4.0
Updated
StyleSheetListto inherit fromArray, as per the latest CSSOM spec. - 5.4.0
Overhauled the handling of attributes throughout the DOM, to follow the spec more exactly.
- 5.4.0
Removed a few functions that were erroneously added to
window:mapper,mapDOMNodes, andvisitTree. - 5.2.0
Moved
childrenfromNodetoParentNode, i.e., made it available onDocument,DocumentFragment, andElement, but not other types of nodes. - 5.2.0
Made
childrenaHTMLCollectioninstead of aNodeList. - 5.1.0
Updated tough-cookie to 0.13.0, bringing along many spec compliance fixes.
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.