Closed Bug 1808174 Opened 3 years ago Closed 2 months ago

Firefox Flatpak: No "activate" in Web Notification Popup

Categories

(Toolkit :: Alerts Service, defect, P3)

Unspecified
Linux
defect

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: argonvegell, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:108.0) Gecko/20100101 Firefox/108.0

Steps to reproduce:

  1. Go to HTML5 Web Notifications Test - Bennish.net: https://www.bennish.net/web-notifications.html

  2. Click on "Authorize" then "Allow," and press on "Show."

Actual results:

The Web Notification Popup appears, however, there is no "Activate" on it.

Expected results:

The Web Notification Popup should have "Activate" on it.

This doesn't affect the default install of Firefox on Xubuntu though.

I'm running Xubuntu 20.04 and attached to this bug report are screenshots of both the default install of Firefox on Xubuntu and the flatpak version of Firefox.

The Bugbug bot thinks this bug should belong to the 'Core::Graphics: WebRender' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Graphics: WebRender
Product: Firefox → Core
Blocks: flatpak
Component: Graphics: WebRender → Widget: Gtk
OS: Unspecified → Linux

UPDATE: Thanks to the assistance of Redditor u/chrisawi, we were able to find a workaround to this issue: https://old.reddit.com/r/flatpak/comments/109oahf/is_this_a_bug_with_firefox_or_a_permissions_issue/j404ewp/

Ideally xfce4-notifyd would support default actions, or at least do something useful with an empty action name.

I think I've found the source of the issue though. libnotify 0.8.0 uses the Notifications portal when running inside flatpak, and the name is getting lost during this translation.

As a workaround, you can try setting NOTIFY_IGNORE_PORTAL=1 for Firefox in Flatseal.

Using Flatseal, scroll to 'Environment' and click the '+' next to 'Variables' to add NOTIFY_IGNORE_PORTAL=1 to the new field.

Setting NOTIFY_IGNORE_PORTAL=1 fixing this issue.

On Steam Deck with KDE Plasma, clicking notifications gives no feedback to Firefox and NOTIFY_IGNORE_PORTAL=1 just makes Firefox fail to run libnotify backend and fall back to XUL one. Chrome has no problem, I wonder the difference. Both are in flatpak packages.

Stransky, do you have idea about how things can fail here?

Flags: needinfo?(stransky)

Is Chrome run as X11 or Wayland? You may try to use Firefox on the same backend.
Is Firefox/Chrome running as a regular app or as a flatpak?

Flags: needinfo?(stransky)

Both run as flatpak, and per flatseal the X11 fallback is disabled on Chrome, so I guess it's wayland by default. I also tried forcing Wayland via about:flags just in case.

On Firefox I guess MOZ_ENABLE_WAYLAND=1 means Wayland.

But notifications are opened by KDE Plasma in both cases which runs on Wayland, does it still matter that whether browsers are on X11/Wayland?

If libnotify library is missing Firefox fallbacks to XUL.
You may miss libnotify libraries for Firefox flatpak runtime so Firefox can't find them.

The relevant code is here:
https://searchfox.org/mozilla-central/rev/6bc0f370cc459bf79e1330ef74b21009a9848c91/toolkit/system/gnome/nsAlertsIconListener.cpp#99

may you run Firefox with dynamic linker ld.so logging? see https://man7.org/linux/man-pages/man8/ld.so.8.html
But I'm not sure how that works with flatpak.

Oh it does run libnotify backend, what I said in comment #3 only applies with extra NOTIFY_IGNORE_PORTAL=1 suggested by comment #2. The problem (without extra settings) is that, clicking notification does nothing (the notification does not close and click event does not trigger). XUL backend can receive click though.

See https://github.com/GNOME/libnotify/blob/master/libnotify/notify.c
NOTIFY_IGNORE_PORTAL comes from libnotify library directly so it's not related to Firefox itself.

So you say the issue here is that the notify can't be clicked on and it doesn't focus to Firefox then, right? But I don't think that's related to flatpak, looks like a general Firefox bug here.

I'm a bit confused. I tested both Chrome/Firefox with default libnotify backend and both are missing Activate button. Looks like the Activate comes from build-in XUL notifications. Or libnotify behaves differently on different environments.

(In reply to Martin Stránský [:stransky] (ni? me) from comment #9)

See https://github.com/GNOME/libnotify/blob/master/libnotify/notify.c
NOTIFY_IGNORE_PORTAL comes from libnotify library directly so it's not related to Firefox itself.

So you say the issue here is that the notify can't be clicked on and it doesn't focus to Firefox then, right? But I don't think that's related to flatpak, looks like a general Firefox bug here.

The thing is that it's broken only with flatpak 🤔

(In reply to Martin Stránský [:stransky] (ni? me) from comment #10)

I'm a bit confused. I tested both Chrome/Firefox with default libnotify backend and both are missing Activate button. Looks like the Activate comes from build-in XUL notifications. Or libnotify behaves differently on different environments.

That's... uh, interesting...

Duplicate of this bug: 1926940
Component: Widget: Gtk → Alerts Service
Product: Core → Toolkit
Version: Firefox 108 → unspecified

As described in comment #2, the workaround is to add NOTIFY_IGNORE_PORTAL=1 for environment and also add org.freedesktop.Notifications in Session Bus/Talks. (Without the latter it will just fall back to XUL as described in comment #3.)

No longer duplicate of this bug: 1926940

The severity field is not set for this bug.
:nalexander, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(nalexander)

(In reply to Kagami Rosylight [:saschanaz] (they/them) from comment #3)

On Steam Deck with KDE Plasma, clicking notifications gives no feedback to Firefox and NOTIFY_IGNORE_PORTAL=1 just makes Firefox fail to run libnotify backend and fall back to XUL one. Chrome has no problem, I wonder the difference. Both are in flatpak packages.

Adding some context here, Chrome's implementation only uses non-portal org.freedesktop.Notifications regardless of being in flatpak or not, while libnotify tries to use portal when in flatpak.

Severity: -- → S4
Flags: needinfo?(nalexander)
Priority: -- → P3

There's a KDE Plasma fix landed to 6.4.1. Not sure there will be a backport to 6.3. It'll probably be out next month given their 4-month release cycle.

Confirmed the fix with KDE 6.4.1. Closing.

Status: UNCONFIRMED → RESOLVED
Closed: 2 months ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: