Changes to notifications module required by webext-sdk
Background
Users of the webext-sdk
don't have direct access to the prefs
module, but they do have access to the notifications
module. So some changes to the notifications
module are required in order to control the notifications mechanism without access to the prefs
module.
What to change
- Add
notifications.numBlocked
that can be set instead ofPrefs.blocked_total
.- Still consider
Prefs.blocked_total
(andPrefs.show_statsinpopup
) if available for backwards compatibility.
- Still consider
- Add
notifications.getDownloadCount()
(wrappingPrefs.notificationdata.downloadCount
). - Add
notifications.getIgnoredCategories()
(wrappingPrefs.notifications_ignoredcategories
). - Derive the
Notifications
class fromEventEmitter
and implement the following events:-
downloaded
: Emitted when a new notification data download was processed and the download count has been updated. -
ignored-category-added
: Emitted when an ignored category was added. -
ignored-category-removed
: Emitted when an ignored category was removed.
-