feediron / ttrss_plugin-feediron

Evolution of ttrss_plugin-af_feedmod
https://discourse.tt-rss.org/t/plugin-update-feediron-v1-2-0/2018
MIT License
212 stars 34 forks source link

Feature: Resolve protocol-relative URLs #123

Open pR0Ps opened 5 years ago

pR0Ps commented 5 years ago

Sites that use protocol-relative URLs for external resources (ex: <img src="//example.org/some_image.jpg"/>) expect the resource to be loaded using the same protocol as the site. However, when pulling that URL into a feed reader, the resource is loaded based on the protocol used by the reader to show the content. This mismatch can create issues, for example if the reader caches the content to disk and displays it via a file:// URL.

For now, I've been using the following pattern as a workaround for specific cases:

"modify": [
    {
        "type": "replace",
        "search": "src=\"\/\/",
        "replace": "src=\"https:\/\/"
    }
]

These URLs should probably be automatically converted to protocol-absolute links so these sorts of workarounds aren't needed.

dugite-code commented 5 years ago

Interesting, I haven't encountered any links like this personally. One solution I have toyed with in the past is a global modify option with url exclusions.

Note: After I merge the tags branch I want to do a feature freeze for a few months in order to focus on significant code re-factoring