mozilla-mobile / fenix

⚠️ Fenix (Firefox for Android) moved to a new repository. It is now developed and maintained as part of: https://github.com/mozilla-mobile/firefox-android

Home Page:https://github.com/mozilla-mobile/firefox-android

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug] Extensions can no longer create notifications

dessant opened this issue · 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.

#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

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.

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

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, notifications do not show up at all, nothing happens when the API is called. The browser.notifications API only worked up to Firefox 78.

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

@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.

@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.

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 I believe what you are seeing is this issue in AC: mozilla-mobile/android-components#7477