lwindolf / liferea

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

Links will not open in regular browsers properly (but does in flatpak) #1326

Closed Kyther closed 6 months ago

Kyther commented 6 months ago

I'm running Liferea 1.13.7 on Linux Mint 21.2.

My default browser is Pale Moon, but I tried manually putting in firefox %s as well, to no avail. What happens is, if I click on a link in Liferea to open in an external browser, I get this message:

"Pale Moon is already running, but is not responding. To open a new window, you must first close the existing Pale Moon process, or restart your system."

Pale Moon is responding perfectly fine - just not to Liferea. Firefox gives the exact same message if I try setting Liferea to use Firefox as the external browser. Brave (a flatpak) actually works fine - but I don't want these articles to open with Brave, I want them to open with Pale Moon!

I tried just setting it to Default Browser (which is Pale Moon) and that triggers the "already running but isn't responding" message. So something in Liferea's external browser configuration isn't working properly. It worked beautifully on my older Mint 18.1 system, so I know it at least used to work right, lol.

The command I used for Brave that worked was: /usr/bin/flatpak run --branch=stable --arch=x86_64 --command=brave --file-forwarding com.brave.Browser @@u %s @@

What aspect of this command makes it work where palemoon %s does not? Any ideas what I need to edit to make it work? (I tried just adding the @@u and @@ around the %s like above but that didn't change anything.)

lwindolf commented 6 months ago

@Kyther If you run firefox <url> from the command line is the effect the same?

Kyther commented 6 months ago

@lwindolf No, it works just fine when I do that from the command line. Same with Pale Moon. It is only when trying to open them from Liferea that I get that message.

lwindolf commented 6 months ago

Thats very strange. I have no idea how Liferea can trigger this behaviour. If you are willing to test some more. How about the behaviour with

  firefox --new-instance <url>
  firefox --new-window <url>
  firefox --new-tab <url>
Kyther commented 6 months ago

With the --new-instance option it fails with the same "already running, but is not responding" message on the command line.

With --new-window it works on the command line but fails in Liferea (same message).

With --new-tab it also works on the command line but fails in Liferea. Again, same message.

bbhtt commented 6 months ago

A few things to check:

  1. Are you on wayland or x11? Is firefox running on wayland or x11/xwayland (about:support > Window Protocol)? Do you have some environment variables to set for Firefox like MOZ_ENABLE_WAYLAND, GDK_BACKEND etc.?
  2. Is there a .parentlock or .lock file somehow remaining in your firefox profile folder?
  3. Is dbus on your desktop setup correctly? What does echo $(dbus-launch) say?
  4. Does putting MOZ_DBUS_REMOTE=1 in /etc/environment then restarting work?
Kyther commented 6 months ago
  1. I'm on X11, as far as I know. I've never done anything with Wayland, and last I knew that was opt-in, not opt-out so I'm presuming Firefox is also running on X11. (Also, I thought Wayland support only comes in Mint 21.3, and I'm on 21.2? But I could be wrong.) I have no idea about environment variables for Firefox, you're getting beyond my ken.

  2. There's definitely a .lock file in my Firefox profile folder - I'm doing all of this while Firefox is open. I thought that was the point of all this. I keep my browsers open all the time, and Liferea's behavior is supposed to be that it opens the link in a new tab in whatever already-open browser it's set to use. The issue is that it's behaving as if it's trying to open a new instance instead of a new tab, no matter what flags I set it to. (The same, I believe, is true about Pale Moon. I haven't tested with Ungoogled Chromium because that's an appimage so more complicated. The fact that Brave - a flatpak - works fine is extremely odd. The only other browser I have is Opera - as a flatpak.)

  3. I have no idea, I haven't messed with it at all, as this is a new computer and I don't know anything about setting up dbus. Running that command gives this: DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-kqXjYLtA7x,guid=fdc782f9a8987e16d4d0760d6583a1dc DBUS_SESSION_BUS_PID=1811977 DBUS_SESSION_BUS_WINDOWID=171966465

  4. I wasn't planning on restarting this computer any time soon. I have dozens of programs and documents open that I'm working on. Part of why I love Linux is I don't have to restart all the time, lol, as it's very difficult for me to do so. I'd need a compelling reason why that test needs to be run (a test I don't currently understand at all) before I'd go through all the work of shutting down everything and opening it all back up, just to see. I'm not saying you can't convince me, but I prefer to understand what I'm doing and, especially in cases like this, have a reasonable suspicion that what I'm going to do is actually going to work before I try something that takes a lot of effort.

bbhtt commented 6 months ago

Mint means everything is x11, that's fine. The dbus variables are also fine.

Firefox uses dbus to communicate link opens from other applications, so either something got corrupted in the Firefox profile or something is blocking access to the proper bus.

This isn't an issue with Liferea at all, links from other applications will also fail to open in firefox in this state.

In any case, you need to restart Firefox/system to try to solve it

Kyther commented 6 months ago

Actually, links from other applications are opening just fine. I just tested opening links from my IRC client with both the default browser and custom setting to firefox %u - apparently it was set to firefox '%u', actually - but both worked perfectly. (The apostrophes made no difference with Liferea.) Only Liferea fails with it. And the issue definitely happens on Pale Moon as well as on Firefox.

Also, I checked and I ended up installing ungoogled-chromium properly (I'd thought I would have to use the appimage, and it's been A Week of configuring and installing so I forgot I had found a method of installing properly) - and when I try putting /usr/bin/chromium %s in Liferea, it simply doesn't respond. I don't get any error message like I do if it tries to use Pale Moon or Firefox - but it also doesn't open any of the links. It does work perfectly fine with my IRC client, though.

My email client (Thunderbird) doesn't appear to have any options to switch default browsers, but links open in Pale Moon without any issues. It's only links from Liferea that fail, though only with browsers that are installed via normal methods. I even tested with Opera just now, and yes, it works fine. So it has no issues with flatpaks, but normal installed browsers fail. /\o/\

bbhtt commented 6 months ago

Possibly it is using different methods to open links like xdg-open. Testing with other browsers won't help, the issue is in your current Firefox installation and specific to Firefox.

Kyther commented 6 months ago

If this is a problem specific to Firefox, then why do I have the same problem with Pale Moon? Why does Chromium also not work to open tabs from Liferea?

This is an extremely new computer, and I did not copy any data over from any previous profiles so it shouldn't have had a chance to be corrupted. The installation is the default one that came already installed with Mint, so I definitely didn't do anything to it. I'm not saying it's impossible for something to have happened with my Firefox installation in less than a month, but it's quite unlikely - and it definitely would NOT explain why Liferea won't open links in two other browsers, one of which isn't even remotely related to Firefox. The only commonality between all three browsers that fail, vs. the two that work, is the method of installation. Which makes no sense to me.

I actually don't care if the links open properly in Firefox or not - I wanted them to open in Pale Moon, which is my default. I only tested with Firefox to check if it was just the default browser that it had issues with, and found it wouldn't work there either. That's how I guessed it had to be an issue with Liferea, since everything else worked fine with Pale Moon except for this one program.

bbhtt commented 6 months ago

Is Liferea installed as a flatpak or from your distro?

Kyther commented 6 months ago

I installed Liferea from the Mint repo.

bbhtt commented 6 months ago

For chromium, can you try running liferea --debug-all then click open in external browser and post the last part of the log?

Kyther commented 6 months ago

headdesk Well, now it works with everything. Apparently Liferea had a fit. Restarting it made it work with all the browsers now (tested with both Chromium as requested, and then Pale Moon and even Firefox to be sure, when I found Chromium worked). Still don't know why it had a fit in the first place, but there you go. Didn't even occur to me to just restart it, which would have been a good idea, lol.

In case you were curious, the debug gave this:

GUI    : handle URL: false false true
GUI    : Running the browser-remote chromium http://blog.paperbackswap.com/ya-teen-fantasy-the-chaos/2023/12/ command
Opening in existing browser session.
CONF   : Setting last-window-state to 0

But then, that's what it looks like when it actually works. So we still don't know why it glitched out, but it probably doesn't matter if a simple restart of the program will fix things (since I didn't restart anything else). I guess this is solved!

bbhtt commented 6 months ago

OK, nice, glad you could figure it out.

Kyther commented 6 months ago

Yeah, I feel a bit silly for not trying that in the first place (or remembering that I hadn't) - but someone else may have the same issue someday, so having this up may prove useful to someone at some point. Who knows?