martinrotter / rssguard

Feed reader (and podcast player) which supports RSS/ATOM/JSON and many web-based feed services.
GNU General Public License v3.0
1.45k stars 120 forks source link

[FR]: Resolving relative URLs #652

Closed guihkx closed 2 years ago

guihkx commented 2 years ago

Brief description of the feature request

Just a minor request (I hope 😄), and I'm not sure if this is specific to the NOWEBENGINE build, but take this sample ATOM feed from a GitLab repository:

<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/">
<title>pipewire:master commits</title>
<link href="https://gitlab.freedesktop.org/pipewire/pipewire/-/commits/master?feed_token=&amp;format=atom" rel="self" type="application/atom+xml"/>
<link href="https://gitlab.freedesktop.org/pipewire/pipewire/-/commits/master" rel="alternate" type="text/html"/>
<id>https://gitlab.freedesktop.org/pipewire/pipewire/-/commits/master</id>
<updated>2022-02-22T12:42:36+01:00</updated>
<entry>
  <id>https://gitlab.freedesktop.org/pipewire/pipewire/-/commit/542b0acd7334b8817d9ac7df419f42b0e1c58093</id>
  <link href="https://gitlab.freedesktop.org/pipewire/pipewire/-/commit/542b0acd7334b8817d9ac7df419f42b0e1c58093"/>
  <title>context: set zero_denormals in data thread.</title>
  <updated>2022-02-22T11:31:06+01:00</updated>
  <media:thumbnail width="40" height="40" url="https://secure.gravatar.com/avatar/658fd1a5efb5b1865941c856f54b9ee8?s=80&amp;d=identicon"/>
  <author>
    <name>Wim Taymans</name>
    <email>wtaymans@redhat.com</email>
  </author>
  <summary type="html">
Use invoke to set the zero-denormals flag from the data thread when
explicitly set. The flag is per thread and should really only be set on
the data thread and only when explicitly enabled.

Fixes &lt;a href="/pipewire/pipewire/-/issues/2160" data-original="#2160" data-link="false" data-link-reference="false" data-project="4753" data-issue="51116" data-reference-type="issue" data-container="body" data-placement="top" title="pw_context_new sets DAZ bits in MXCSR register, crashes LuaJIT" class="gfm gfm-issue has-tooltip"&gt;#2160&lt;/a&gt;</summary>
</entry>
</feed>

RSS Guard will render the message like this in the NOWEBENGINE version (which is correct, as far as I can tell):

image

However, despite that #2160 link at the end being clickable, when you try to click on it, the external web browser won't open, because it's not an absolute URL and I think RSS Guard can't handle relative URLs at the moment...?

Thank you!

martinrotter commented 2 years ago

There already was/is some logic to deal with realtive URLs within feed entries.

In WebEngine variant of RSS Guard, I set base URL correctly when possible and relative URLs should just work.

In Non-webengine build I agree, it probably is not just there. Let me check.

martinrotter commented 2 years ago

Can you re-test with latest [master]?

martinrotter commented 2 years ago

I believe this is fixed, tested with feed https://gitlab.freedesktop.org/pipewire/pipewire/-/commits/master?feed_token=&amp;format=atom

guihkx commented 2 years ago

On what desktop environment did you test this? I grabbed the latest dev AppImage to test it, but on GNOME it doesn't work when you try to open the link in the external web browser (internal browser works though):

gio: file:///pipewire/pipewire/-/issues/2328: Error when getting information for file “/pipewire/pipewire/-/issues/2328”: No such file or directory

https://user-images.githubusercontent.com/626206/166232409-6cafc15a-7295-49a0-a3df-b77348b2c9d4.mp4

Full log:

time="     0.081" type="debug" -> core: Initializing settings in '/home/gui/.config/RSS Guard 4/config/config.ini' (non-portable way).
time="     0.130" type="debug" -> database: File-based SQLite database connection 'DatabaseFactory' to file '/home/gui/.config/RSS Guard 4/database/database.db' seems to be established.
time="     0.131" type="debug" -> database: File-based SQLite database has version '2'.
time="     0.131" type="debug" -> gui: Available icon theme paths: (/home/gui/.local/share/icons, /var/lib/flatpak/exports/share/icons, /usr/share/icons, :/icons, :/graphics, /home/gui/.config/RSS Guard 4/icons, /tmp/.mount_rssguaBx9DWj/usr/bin/icons)
time="     0.137" type="debug" -> gui: Installed icon themes are: '', 'hicolor', 'Adwaita', 'default', 'ePapirus', 'ePapirus-Dark', 'Papirus', 'Papirus-Light', 'Papirus-Dark', 'HighContrast'
time="     0.138" type="debug" -> gui: Loading default system icon theme.
time="     0.140" type="debug" -> gui: Found path of base skin: ':/skins/nudus-base'.
time="     0.140" type="debug" -> gui: Trying to load base file ':/skins/nudus-base/html_wrapper.html' for the skin.
time="     0.140" type="debug" -> gui: Local file ':/skins/nudus-light/html_style.css' exists, using it for the skin.
time="     0.140" type="debug" -> gui: Trying to load base file ':/skins/nudus-base/html_enclosure_image.html' for the skin.
time="     0.140" type="debug" -> gui: Trying to load base file ':/skins/nudus-base/html_single_message.html' for the skin.
time="     0.140" type="debug" -> gui: Trying to load base file ':/skins/nudus-base/html_enclosure_every.html' for the skin.
time="     0.140" type="debug" -> gui: Local file ':/skins/nudus-light/qt_style.qss' exists, using it for the skin.
time="     0.140" type="debug" -> gui: Trying to load base file ':/skins/nudus-base/html_adblocked.html' for the skin.
time="     0.140" type="debug" -> gui: Setting style: 'Fusion'.
time="     0.148" type="debug" -> gui: Skin 'nudus-light' loaded.
time="     0.148" type="debug" -> network: Disabling application-wide proxy completely.
time="     0.191" type="debug" -> core: OpenSSL version: 'OpenSSL 1.1.1  11 Sep 2018'.
time="     0.191" type="debug" -> core: OpenSSL supported: 'true'.
time="     0.191" type="debug" -> core: Starting RSS Guard 4.2.2.
time="     0.191" type="debug" -> core: Instantiated class  'Application'.
time="     0.193" type="debug" -> core: Starting to load active localization. Desired localization is 'en_US'.
time="     0.194" type="debug" -> core: Application localization 'en_US' loaded successfully, specifically sublocalization 'en_US' was loaded.
time="     0.194" type="warning" -> core: Qt localization 'en_US' WAS NOT loaded successfully.
time="     0.215" type="debug" -> database: SQLite database connection 'MessagesModel' to file '/home/gui/.config/RSS Guard 4/database/database.db' seems to be established.
time="     0.238" type="debug" -> message-model: Repopulated model, SQL statement is now:
 'SELECT Messages.id, Messages.is_read, Messages.is_important, Messages.is_deleted, Messages.is_pdeleted, Messages.feed, Messages.title, Messages.url, Messages.author, Messages.date_created, Messages.contents, Messages.enclosures, Messages.score, Messages.account_id, Messages.custom_id, Messages.custom_hash, Feeds.title, CASE WHEN length(Messages.enclosures) > 10 THEN 'true' ELSE 'false' END AS has_enclosures FROM Messages LEFT JOIN Feeds ON Messages.feed = Feeds.custom_id AND Messages.account_id = Feeds.account_id WHERE 0 > 1;'.
time="     0.239" type="debug" -> core: Auto-download timer started with interval 60000 ms.
time="     0.239" type="debug" -> core: Creating FeedDownloader singleton.
time="     0.249" type="debug" -> gui: Creating main application form in thread: '0x7f6098299cc0'.
time="     0.350" type="debug" -> gui: Current row changed - proxy 'QModelIndex(-1,-1,0x0,QObject(0x0))', source 'QModelIndex(-1,-1,0x0,QObject(0x0))'.
time="     0.394" type="debug" -> network: Settings of BaseNetworkAccessManager loaded.
time="     0.410" type="debug" -> network: Settings of BaseNetworkAccessManager loaded.
time="     0.418" type="debug" -> network: Settings of BaseNetworkAccessManager loaded.
time="     0.468" type="debug" -> gui: Creating tray icon menu.
time="     0.658" type="debug" -> core: OS asked application to save its state.
time="     0.659" type="debug" -> CTRL is NOT pressed while sorting articles - sorting with standard mode.
time="     0.660" type="debug" -> message-model: Repopulated model, SQL statement is now:
 'SELECT Messages.id, Messages.is_read, Messages.is_important, Messages.is_deleted, Messages.is_pdeleted, Messages.feed, Messages.title, Messages.url, Messages.author, Messages.date_created, Messages.contents, Messages.enclosures, Messages.score, Messages.account_id, Messages.custom_id, Messages.custom_hash, Feeds.title, CASE WHEN length(Messages.enclosures) > 10 THEN 'true' ELSE 'false' END AS has_enclosures FROM Messages LEFT JOIN Feeds ON Messages.feed = Feeds.custom_id AND Messages.account_id = Feeds.account_id WHERE 0 > 1 ORDER BY Messages.date_created DESC;'.
time="     0.668" type="debug" -> core: Showing the main window when the application is starting.
time="     0.671" type="debug" -> database: SQLite database connection 'FeedReader' to file '/home/gui/.config/RSS Guard 4/database/database.db' seems to be established.
time="     0.672" type="debug" -> database: SQLite database connection 'FeedlyEntryPoint' to file '/home/gui/.config/RSS Guard 4/database/database.db' seems to be established.
time="     0.674" type="debug" -> database: SQLite database connection 'GmailEntryPoint' to file '/home/gui/.config/RSS Guard 4/database/database.db' seems to be established.
time="     0.675" type="debug" -> database: SQLite database connection 'GreaderEntryPoint' to file '/home/gui/.config/RSS Guard 4/database/database.db' seems to be established.
time="     0.676" type="debug" -> database: SQLite database connection 'OwnCloudServiceEntryPoint' to file '/home/gui/.config/RSS Guard 4/database/database.db' seems to be established.
time="     0.676" type="debug" -> database: SQLite database connection 'StandardServiceEntryPoint' to file '/home/gui/.config/RSS Guard 4/database/database.db' seems to be established.
time="     0.684" type="debug" -> core: Filter accepts row 'gui (RSS/ATOM/JSON)' and filter result is: 'true'.
time="     0.685" type="debug" -> database: SQLite database connection 'StandardServiceRoot' to file '/home/gui/.config/RSS Guard 4/database/database.db' seems to be established.
time="     0.686" type="debug" -> core: Custom ID of feed when loading from DB is '2'.
time="     0.686" type="debug" -> database: SQLite database connection 'RecycleBin' to file '/home/gui/.config/RSS Guard 4/database/database.db' seems to be established.
time="     0.686" type="debug" -> database: SQLite database connection 'ImportantNode' to file '/home/gui/.config/RSS Guard 4/database/database.db' seems to be established.
time="     0.687" type="debug" -> database: SQLite database connection 'RootItem' to file '/home/gui/.config/RSS Guard 4/database/database.db' seems to be established.
time="     0.687" type="debug" -> database: SQLite connection 'StandardServiceRoot' is already active.
time="     0.687" type="debug" -> database: SQLite database connection 'StandardServiceRoot' to file '/home/gui/.config/RSS Guard 4/database/database.db' seems to be established.
time="     0.687" type="debug" -> database: SQLite database connection 'TtRssServiceEntryPoint' to file '/home/gui/.config/RSS Guard 4/database/database.db' seems to be established.
time="     0.687" type="debug" -> gui: User wants to have tray icon.
time="     0.688" type="warning" -> gui: Showing tray icon with 3000 ms delay.
time="     0.688" type="debug" -> gui: Feed list item expanded - gui (RSS/ATOM/JSON)
time="     0.688" type="debug" -> core: Filter accepts row 'Recycle bin' and filter result is: 'true'.
time="     0.688" type="debug" -> core: Filter accepts row 'Important articles' and filter result is: 'true'.
time="     0.688" type="debug" -> core: Filter accepts row 'Unread articles' and filter result is: 'true'.
time="     0.688" type="debug" -> core: Filter accepts row 'Labels' and filter result is: 'true'.
time="     0.688" type="debug" -> core: Filter accepts row 'pipewire:master commits' and filter result is: 'true'.
time="     0.688" type="debug" -> core: No execution message received from other app instances.
time="     1.152" type="debug" -> network: Settings of BaseNetworkAccessManager loaded.
time="     1.850" type="debug" -> network: Destroying Downloader instance.
time="     1.850" type="debug" -> network: Destroying SilentNetworkAccessManager instance.
time="     2.574" type="debug" -> CTRL is NOT pressed while sorting articles - sorting with standard mode.
time="     2.574" type="debug" -> Displaying messages from feeds IDs: ''2'' and URLs: 'https://gitlab.freedesktop.org/pipewire/pipewire/-/commits/master?feed_token=AKX-Rmji-aoqtg-JTmbX&format=atom'.
time="     2.576" type="debug" -> message-model: Repopulated model, SQL statement is now:
 'SELECT Messages.id, Messages.is_read, Messages.is_important, Messages.is_deleted, Messages.is_pdeleted, Messages.feed, Messages.title, Messages.url, Messages.author, Messages.date_created, Messages.contents, Messages.enclosures, Messages.score, Messages.account_id, Messages.custom_id, Messages.custom_hash, Feeds.title, CASE WHEN length(Messages.enclosures) > 10 THEN 'true' ELSE 'false' END AS has_enclosures FROM Messages LEFT JOIN Feeds ON Messages.feed = Feeds.custom_id AND Messages.account_id = Feeds.account_id WHERE Feeds.custom_id IN ('2') AND Messages.is_deleted = 0 AND Messages.is_pdeleted = 0 AND Messages.account_id = 1 ORDER BY Messages.date_created DESC;'.
time="     2.583" type="debug" -> core: Filter accepts row 'gui (RSS/ATOM/JSON)' and filter result is: 'true'.
time="     2.583" type="debug" -> core: Filter accepts row 'pipewire:master commits' and filter result is: 'true'.
time="     2.583" type="debug" -> core: Filter accepts row 'Labels' and filter result is: 'true'.
time="     2.583" type="debug" -> core: Filter accepts row 'Important articles' and filter result is: 'true'.
time="     2.583" type="debug" -> core: Filter accepts row 'Unread articles' and filter result is: 'true'.
time="     2.583" type="debug" -> core: Filter accepts row 'Recycle bin' and filter result is: 'true'.
time="     3.685" type="warning" -> gui: Tray icon is available, showing now.
time="     3.689" type="debug" -> gui: Creating SystemTrayIcon instance.
time="     3.694" type="debug" -> gui: Showing tray icon immediately.
time="     3.695" type="debug" -> gui: Tray icon displayed.
time="     4.641" type="debug" -> gui: Message list got focus with reason 'Qt::MouseFocusReason'.
time="     4.641" type="debug" -> gui: Current row changed - proxy 'QModelIndex(21,6,0x55fac0f3b710,MessagesProxyModel(0x55fac0f14500, name = MessagesProxyModel))', source 'QModelIndex(21,6,0x0,MessagesModel(0x55fac0ee09f0))'.
time="     5.247" type="debug" -> gui: Hovered link: 'QUrl(https://secure.gravatar.com/avatar/658fd1a5efb5b1865941c856f54b9ee8?s=80&d=identicon)'.
time="     5.270" type="debug" -> gui: Hovered link: 'QUrl()'.
time="     5.497" type="debug" -> gui: Hovered link: 'QUrl(https://secure.gravatar.com/avatar/658fd1a5efb5b1865941c856f54b9ee8?s=80&d=identicon)'.
time="     5.512" type="debug" -> gui: Hovered link: 'QUrl()'.
time="     5.518" type="debug" -> gui: Hovered link: 'QUrl(https://gitlab.freedesktop.org/pipewire/pipewire/-/commit/d9871f36c19b91f4fa80bed3fe4feea38e17e41b)'.
time="     5.524" type="debug" -> gui: Hovered link: 'QUrl()'.
time="     6.200" type="debug" -> gui: Message splitter moved.
time="     9.231" type="debug" -> gui: Message list got focus with reason 'Qt::ActiveWindowFocusReason'.
time="    10.482" type="debug" -> gui: Message list got focus with reason 'Qt::ActiveWindowFocusReason'.
time="    10.786" type="debug" -> gui: Hovered link: 'QUrl(https://gitlab.freedesktop.org/pipewire/pipewire/-/commit/d9871f36c19b91f4fa80bed3fe4feea38e17e41b)'.
time="    11.047" type="debug" -> gui: Hovered link: 'QUrl()'.
time="    11.074" type="debug" -> gui: Hovered link: 'QUrl(https://secure.gravatar.com/avatar/658fd1a5efb5b1865941c856f54b9ee8?s=80&d=identicon)'.
time="    11.136" type="debug" -> gui: Hovered link: 'QUrl()'.
time="    12.581" type="debug" -> gui: Hovered link: 'QUrl(https://secure.gravatar.com/avatar/658fd1a5efb5b1865941c856f54b9ee8?s=80&d=identicon)'.
time="    12.825" type="debug" -> gui: Hovered link: 'QUrl()'.
time="    12.991" type="debug" -> gui: Hovered link: 'QUrl(/pipewire/pipewire/-/issues/2328)'.
time="    14.453" type="debug" -> gui: Hovered link: 'QUrl()'.
time="    14.514" type="debug" -> gui: Hovered link: 'QUrl(/pipewire/pipewire/-/issues/2328)'.
time="    14.543" type="debug" -> gui: Hovered link: 'QUrl()'.
time="    14.799" type="debug" -> gui: Hovered link: 'QUrl(/pipewire/pipewire/-/issues/2328)'.
time="    15.029" type="debug" -> gui: Hovered link: 'QUrl()'.
time="    15.462" type="debug" -> gui: Hovered link: 'QUrl(/pipewire/pipewire/-/issues/2328)'.
time="    16.399" type="debug" -> gui: Message list got focus with reason 'Qt::ActiveWindowFocusReason'.
time="    18.232" type="debug" -> network: We are trying to open URL '/pipewire/pipewire/-/issues/2328'.
gio: file:///pipewire/pipewire/-/issues/2328: Error when getting information for file “/pipewire/pipewire/-/issues/2328”: No such file or directory
time="    60.185" type="debug" -> core: Starting auto-download event, remaining 15 minutes out of 15 total minutes to next global feed update.
time="   120.191" type="debug" -> core: Starting auto-download event, remaining 15 minutes out of 15 total minutes to next global feed update.
time="   180.183" type="debug" -> core: Starting auto-download event, remaining 15 minutes out of 15 total minutes to next global feed update.
martinrotter commented 2 years ago

rssguard_8pUKC51f9C

guihkx commented 2 years ago

Yes, like I mentioned, it works when I open the link using the "internal browser" of RSS Guard, but it doesn't work if I try to open it with the external web browser. Does it work on Windows, though? 🤔

martinrotter commented 2 years ago

OH I see, let me check

martinrotter commented 2 years ago

4348a51d6

Pls test with latest master when devbuild compiles.

guihkx commented 2 years ago

Works now! Thanks! :D