Add notification type for opening a page in a new tab
Background
For https://gitlab.com/eyeo/adblockplus/abpui/adblockplusui/issues/728 we need to open a link in a new tab using the notification system in order to have a staged rollout and to be able to disable the notification remotely. However, since the notification system revamp is yet to be done, that means that we need a new notification type to achieve this.
What to change
- Add "newtab" notification type with same severity as "relentless" notifications.
- Ignore any invalid "newtab" notifications (i.e. ones that don't contain any links).
See spec.
Integration notes
- Notifications can now have the type "newtab".
- Newtab notifications are ensured to include a link.
- Invalid remote notifications are ignored and lead to a warning being logged.
- Attempting to add an invalid local notification using
notifications.addNotification()
will throw.
Hints for testers
- Invalid notifications in notifications.json (e.g. notification with type "newtab" but without any links) are supposed to be ignored without affecting any other notifications.
- All existing notification types should continue to work as expected.
- No errors should be shown in JavaScript console when downloading notifications.json.
Edited by Thomas Greiner