lwindolf / liferea

Liferea (Linux Feed Reader), a news reader for GTK/GNOME
https://lzone.de/liferea
GNU General Public License v2.0
817 stars 130 forks source link

Viewing an entry with an embedded video prevents other entries from being shown #1244

Closed Malvineous closed 1 year ago

Malvineous commented 1 year ago

If you view an item that contains an embedded video, you can't view a different item afterwards. You have to exit and restart Liferea before you can read another item.

Steps to reproduce:

  1. Add subscription to http://feeds.arstechnica.com/arstechnica/index
  2. View a story with a video in it (e.g. "Snoop Dogg on AI risk")
  3. Click on any other item
  4. New item is marked read, but is not shown - original item with embedded video is still visible

This only affects items that contain <video/> tags.

Using Liferea 1.14.4.

lwindolf commented 1 year ago

This usually indicates a Webkit background process crash. Webkit the HTML engine used by Liferea runs webpages in isolated process. The video causes it to crash upon leaving the item. The problem is that there is nothing Liferea can do to control this behaviour.

Most of those crashes are a combination of libwebkit and libgstreamer versions. Some combinations work, some crash. I currently have the most recent Ubuntu 23.04 versions which also cause video crashes with the difference that it terminates Liferea entirely :-(

Sadly won't fix. Upgrading/downgrading libwebkit/libgstreamer could workaround the issue for you.

Malvineous commented 1 year ago

Thanks for the explanation! I'm not familiar with the codebase, but I presume there's no way to launch the Webkit stuff in a separate process, so that Liferea is unaffected by the crash and can detect it and relaunch the process?

Is there any way to work around the problem, e.g. by sanitising the HTML before display, to remove any video tags? There's already the "reader mode" option that appears to do this for script tags - just wondering if that functionality could be partially duplicated to provide another option that would strip out video/media tags?

I don't actually care about the videos so I would be quite happy to have them hidden - I can always double-click on the item to open it in a browser if I really want to watch the video.

lwindolf commented 1 year ago

@Malvineous Webkit already does automatically sandbox it's web renderer processes, which is why in your case Liferea continues to run while the web renderer is dead. But this is all done automatically by the Webkit library and not controlled by Liferea.

If you only want to hide the videos you can use the custom CSS stylesheet (usually in ~/.config/liferea/liferea.css) to define

  video { display: none }
mozbugbox commented 1 year ago

When the Webkit failed to load new feed items, kill the offending WebKitWebProcess process, which often shows up at the top of the top command, will work.

Once the WebKitWebProcess process was killed, a new WebKitWebProcess process will be automatically started by the webkit, and the following feed items will load as normal.

Not sure if the action sequence can be made automatic by Liferea.

Maybe this should be an FAQ item.