You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Resolve relative feed image URLs against the feed URL #38
When an image in the item HTML has a relative src (e.g. /images/article.jpg), the thumbnail is requested from the host of the page that contains the component instead of the host of the feed, so it fails to display when they differ.
The image is extracted by parsing the item HTML into a detached element and reading image.src, which resolves the URL against the page base. This happens in __getImageFromAttribute (rss-items.js) and in the image method injected from RssItems.java when extractImageFromDescription is enabled, for both description and encoded content.
Expected behavior
Relative image URLs are resolved against the feed URL (i.e. read the raw src attribute and resolve it with the feed URL as base). Absolute URLs remain unchanged, and an item without image still results in no image.
Additional information
Found during the review of #36 (#36 (comment)). The demo feed is not affected, since its image URLs are absolute.
Activity