Changes between Version 1 and Version 3 of Ticket #5835


Ignore:
Timestamp:
10/06/2017 02:18:33 PM (3 years ago)
Author:
kzar
Comment:

Sounds sensible to me, except I'm not sure how we could return non-active notifications. I've updated the description does it look OK to you now?

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #5835

    • Property Summary changed from Add notification message handlers for popup to Add "notifications.get" message handler for the popup
  • Ticket #5835 – Description

    v1 v3  
    11=== Background === 
    2 With #5593 we're replacing direct use of the background page from the popup window with messaging. We need to do this for the notification handling code too, but the required message handlers have not been added to adblockplusui/messageResponder.js yet. 
     2With #5593 we're replacing direct use of the background page from the popup window with messaging. We need to do this for the notification handling code too, but the required message handler have not been added to adblockplusui/messageResponder.js yet. 
    33 
    44=== What to change === 
    5 Add the following message handlers: 
     5Add a `"notifications.get"` message handler to adblockplusui/messageResponders.js. 
    66 
    7 - "notifications.getActive" => adblockpluschrome/lib/notificationHelper.js getActiveNotifications() 
    8 - "notifications.shouldDisplay" => adblockpluschrome/lib/notificationHelper.js shouldDisplay() 
    9 - "notifications.getLocalizedTexts" => adblockpluscore/lib/notifications.js getLocalizedTexts() 
     7It should return an Array of active notifications, or an empty Array if there aren't any. The notifications can be fetched using `getActiveNotifications()` in adblockpluschrome/lib/notificationHelper.js. For each notification in the Array the `texts` property should be populated with the result of `getLocalizedTexts()` from adblockpluscore/lib/notifications.js. The `displayMethods` property should also be populated with the result of `getDisplayMethods` from adblockpluschrome/lib/notificationHelper.js. 
     8 
     9=== Integration notes === 
     10The `getDisplayMethods` function will need to be added to, and exported from, adblockpluschrome/lib/notificationHelper.js. It should return `displayMethods[notificationType] || defaultDisplayMethods`.