Skip to content

HtmlUnit 5.9.0

Latest

Choose a tag to compare

@rbri rbri released this 24 Nov 17:52
· 20 commits to master since this release
2b5b4b7

Highlights

  • Browsers: Firefox 160, Chrome/Edge 158
  • Native fetch(): Request, Response, Headers, AbortController/AbortSignal, CORS (preflight,
    credentials, exposed headers), no-cors, cache modes, subresource integrity; available in workers
  • Cookies like the browsers: SameSite enforcement (Lax by default, cross-site frames),
    secure cookies only from secure origins, __Secure-/__Host- prefixes, public suffix list
    incl. private suffixes (e.g. github.io)
  • Content Security Policy: sandbox directive, redirect matching, data: sources,
    new option to disable violation reports
  • iframes: sandbox and srcdoc support; window.origin
  • Referrer policy: header, meta and referrerpolicy attribute
    (default strict-origin-when-cross-origin)
  • Intl: NumberFormat (options, formatToParts, ranges), Collator (options, collations),
    locale negotiation like the browsers

Security

  • Pages not loaded from a file can no longer load or navigate to local files (file: urls)
  • Redirects to non-http(s) urls are a network error
  • No credentials (user:password@) in Referer, Origin and location.href
  • Set-Cookie and forbidden request headers (e.g. Origin) are no longer accessible from JavaScript
  • Temporary files, downloaded attachments and debug reports are readable by the owner only

⚠️ Incompatible changes

  • Local file access from pages not loaded from a file is blocked (scripts, images, CSS, frames,
    window.open, navigation). To get the old behavior back:
    webClient.getOptions().setLocalFileAccessFromRemotePagesAllowed(true)
  • Redirects to local files (and other non-http(s) urls) fail
  • file: urls are serialized as file:///C:/... (before file:/C:/...)
  • The protocol setters (URL, a, area, location) follow the URL Standard;
    location.protocol navigates only to http(s)
  • The MIME type serialization of data urls changed (per browser)
  • htmlunit-csp: the sandbox directive no longer affects the allows*() methods

New options

  • setLocalFileAccessFromRemotePagesAllowed(boolean): allows local file access again
    (default false)
  • setHtmlFragmentSelfClosingTagsAllowed(boolean): reads back <h3/> markup written by
    asXml() before 5.8.0 (default false)
  • setContentSecurityPolicyReportsEnabled(boolean): disables CSP violation reports (default true)

Also

  • window.isSecureContext for loopback addresses, plus many fixes for XMLHttpRequest/CORS,
    HtmlRangeInput and serialization (more handlers are Serializable now)
  • core-js fixes (flatMap holes, for-in shadowing, toPrecision)

Please have a look at the full release notes for details about this release.

💕 Thank you to all who have contributed and to the sponsors (more sponsoring is welcome https://github.com/sponsors/rbri).

Full Changelog: 5.8.0...5.9.0