May and June have been productive months with significant progress on JavaScript compliance and bug fixes. The work across these two releases demonstrates a clear commitment to bringing HtmlUnit closer to real browser behavior.

🚀 Version 5.1.0 - May 31, 2026

This release brings Firefox 151 support along with important JavaScript engine refinements and bug fixes that improve our standards compliance.

JavaScript Engine Enhancements

The core-js improvements continue; we’ve added ECMAScript 2026 Source Map support, enabling proper debugging capabilities for dynamically generated code.

Additionally, I fixed several critical issues with Reflect.set() when working without explicit value arguments, ensuring our implementation matches the ECMAScript specification more closely.

Standards Compliance Fixes

Cookie Handling: I rewrote the cookie serialization logic to properly comply with RFC 6265 section 2, ensuring that cookies are now serialized in the correct order (longer paths first, then by creation time). This might seem like a small detail, but it’s important for applications that depend on cookie ordering.

Location and Navigation: Fixed Location.setHash() to properly update the page’s WebRequest URL when the hash changes, and addressed an issue where WebClient.makeWebResponseForAboutUrl() wasn’t correctly handling about:blank with hash fragments.

Other Improvements

  • Fixed constructor and prototype setup for better JavaScript object hierarchy
  • Improved Array spread handling to properly throw TypeError on non-iterable targets
  • Several internal Rhino improvements for better code generation and error handling

Special thanks to Lai Quang Duong for his dedicated work on enforcing standards compliance throughout this release, particularly for the cookie serialization fixes and location/navigation improvements that ensure HtmlUnit behaves more like real browsers.

🚀 Version 5.2.0 - June 20, 2026

This major release focuses on enhancing JavaScript compatibility, improving Canvas rendering, and keeping pace with the latest browser standards.

JavaScript Engine Advances

The core-js improvements continue to be the centerpiece of this release. I’ve implemented extensive enhancements to the Reflect API and Proxy support, including:

  • New AbstractEcmaObjectOperations.ordinarySet() and ordinarySetWithOwnDescriptor() methods for proper Reflect implementation
  • Improved Reflect set() handling for TypedArrays and proxy receiver semantics
  • Enhanced Proxy support for the receiver parameter when calling the set trap
  • Support for with (proxy) {...} statements, enabling more sophisticated metaprogramming patterns
  • Critical fixes for the Reflect API to properly handle property lookups through the prototype chain

These improvements bring our JavaScript engine significantly closer to ECMAScript specification compliance. There are many more JavaScript features already in development that will land in the next versions.

Canvas API Enhancements

I’ve fixed several important Canvas rendering issues:

  • arc() now correctly appends to the current path rather than replacing it
  • rect() respects the current transformation for the entire rectangle
  • clip() now clips the entire current path, not just the last subpath
  • putImageData() correctly maps source pixels row-major into the destination
  • getImageData() returns pixels in the correct order
  • restore() properly handles alpha channel restoration

These fixes are essential for applications that rely on the HTML5 Canvas for graphics rendering and visualization.

DOM and Media Improvements

  • HTMLMediaElement.canPlayType() is now much closer to real browser behavior
  • Fixed HtmlMeter parent class (was incorrectly HtmlMedia, now HtmlElement)
  • Added Firefox Notification constants and SVG TextPathElement constants
  • Enhanced StyleAttribute with field-sizing support for modern CSS layout

Browser Compatibility Updates

  • Chrome/Edge 149: Setting outerHTML no longer throws when called on detached elements
  • Firefox 152: Various compatibility adjustments for modern Firefox behavior
  • Improved offset calculations for absolutely positioned elements

Infrastructure Updates

  • Upgraded commons-logging to 1.4.0
  • Updated Jetty (websocket-client) to 12.1.10
  • Various internal code optimizations and improvements

The collaborative work with the Rhino team continues to drive progress. Their contributions to the core JavaScript engine—from subtle edge case fixes to major refactorings—have been instrumental in achieving this level of standards compliance.


Both 5.1.0 and 5.2.0 are available on Maven Central. Check out the full changes report for the complete list of changes.

Happy testing!

— RBRi


Resources: