fenix icon indicating copy to clipboard operation
fenix copied to clipboard

[Bug] Extensions can no longer create notifications

Open dessant opened this issue 6 years ago • 11 comments

Steps to reproduce

The API call below no longer shows a notification in Firefox Nightly 200911 14:03.

Extension notifications on Android worked up to Firefox 78. In Firefox 79 and 80 the API call crashes the browser. This crash was recently fixed, but the end result is that notifications are no longer shown.

https://github.com/mozilla-mobile/fenix/issues/12910 https://bugzilla.mozilla.org/show_bug.cgi?id=1649494

browser.notifications.create({type: 'basic', title: 'Title', message: 'Message.'});

Device information

  • Android device: Android 9
  • Fenix version: Firefox Nightly 200911 14:03

┆Issue is synchronized with this Jira Task

dessant avatar Sep 11 '20 16:09 dessant

While notifications work up to Firefox 78, only a notification icon is shown in the status bar and no notification sound is produced. In Fennec a notification popup would also appear, accompanied by a notification sound.

This is causing problems for Search by Image, because errors are shown using notifications and the status bar icons alone are easy to miss, so the user is left wondering why selecting an image does nothing, while there is a notification hiding above about a missing image.

dessant avatar Sep 11 '20 17:09 dessant

@agi do we need GV work to support this API. I did not see anything in Bugzilla.

kbrosnan avatar Oct 07 '20 17:10 kbrosnan

While notifications work up to Firefox 78, only a notification icon is shown in the status bar and no notification sound is produced. In Fennec a notification popup would also appear, accompanied by a notification sound.

@dessant so the notification does show up, but as a silent notification, is that correct? If so, they it's an AC bug probably with the NativeNotificationBridge.

jonalmeida avatar Oct 07 '20 17:10 jonalmeida

@jonalmeida, notifications do not show up at all, nothing happens when the API is called. The browser.notifications API only worked up to Firefox 78.

dessant avatar Oct 07 '20 17:10 dessant

Please see the brief history of the bug in the issue description, it might help find the root of the bug.

dessant avatar Oct 07 '20 17:10 dessant

@kbrosnan no, we do notify AC of the notification through the WebNotificationDelegate::onShowNotification API (there's a test for this in https://phabricator.services.mozilla.com/D88165), this is likely a bug in AC/Fenix.

agi avatar Oct 07 '20 21:10 agi

@dessant Thanks for filing! Just tested in latest Nightly (201027 17:01) to confirm that this works now. Please re-open if you still run into issues.

csadilek avatar Oct 27 '20 18:10 csadilek

I can confirm that the notification is displayed now. But i fear, i have another issue with notifications. If i try to interact with the notification, the onClicked event isnt fired. For example:

browser.notifications.onClicked.addListener(function(notificationId) {
  console.log('Notification ' + notificationId + ' was clicked by the user');
});

This will not triggered. I didnt see the output in the console. Should i open a second issue for this?

Offerel avatar Oct 28 '20 20:10 Offerel

@Offerel please open a bug at https://bugzilla.mozilla.org/enter_bug.cgi?product=GeckoView&component=Extensions . Thanks!

agi avatar Oct 29 '20 02:10 agi

Hopefully this is OK: https://bugzilla.mozilla.org/show_bug.cgi?id=1674069

Offerel avatar Oct 29 '20 08:10 Offerel

@Offerel I believe what you are seeing is this issue in AC: https://github.com/mozilla-mobile/android-components/issues/7477

jonalmeida avatar Oct 29 '20 12:10 jonalmeida