#2603·jsoup

Resolve absolute urls for `srcset`-style attributes

Author: solonovamaxCreated Sep 13, 2026Updated Sep 14, 2026

Currently, there exists Node.absUrl which allows you to resolve an absolute url for any attributes which are only a single url: https://github.com/jhy/jsoup/blob/97a392158f4d849af762ee7e984fb37c18bcd610/src/main/java/org/jsoup/nodes/Node.java#L237-L266

However, no such method exists for something like srcset. The absUrl method calls StringUtil.resolve, however this cannot be used in user code, as this class is intended for internal use only It would be nice if there was either something like absSrcSet (though I understand the desire to not add a single method for just this) or some method on Node which allowed users to resolve any urls they parse in an absolute manner.

Of course, a nasty workaround for this would be to just add each url in the srcset as an attribute on the element, then call absUrl, then remove the attribute.