Opened on 09/08/2015 at 04:57:10 PM

Closed on 09/11/2015 at 06:48:13 PM

Last modified on 09/21/2015 at 09:54:22 AM

#3024 closed change (fixed)

Add notification opt-out to Chrome notifications

Reported by: greiner Assignee: greiner
Priority: P2 Milestone: Adblock-Plus-1.9.3-for-Chrome-Opera-Safari-next
Module: Platform Keywords:
Cc: fhd, sebastian, sven Blocked By:
Blocking: Platform: Chrome
Ready: yes Confidential: no
Tester: Ross Verified working: no
Review URL(s):

https://codereview.adblockplus.org/29327244/

Description (last modified by greiner)

Background

Currently, there is no way of opting-out of notifications if a notification makes only use of desktop notifications. Therefore we should add a way to globally opt-out of notifications similar to the already existing ones implemented in #2191.
Unfortunately, there's no good way to achieve that using standard desktop notifications so we should at least add it to Chrome notifications.

What to change

  • Add a button "Configure notification settings" to Chrome notifications for notifications that don't have the type "critical" or "question".
  • When clicking on the button:
    • Close the notification
    • Set notifications_showui to true
    • Open the options page
    • Show the General tab
  • Due to a Chrome limitation if a notification specifies more than one link, we need to, instead of those, add a button which should trigger the same behavior as clicking on a standard desktop notification: Open all links at once. Therefore we can reuse the existing string notification_without_buttons in that case.

What to test

Check out the suggested setup instructions under #3022.

The expected buttons for the respective notifications are as follows:

  • type=critical
    • more than 2 links
      • button: open all
    • 2 links
      • button: first link
      • button: second link
    • 1 link
      • button: first link
    • no links
      • no button
  • type=question
    • button: yes
    • button: no
  • type=normal
    • more than 2 links
      • button: open all
      • button: configure
    • 2 links
      • button: open all
      • button: configure
    • 1 link
      • button: first link
      • button: configure
    • no links
      • button: configure

Attachments (0)

Change History (11)

comment:1 in reply to: ↑ description ; follow-up: Changed on 09/08/2015 at 05:13:51 PM by sebastian

Replying to greiner:

  • Add a button "Configure notification settings" to Chrome notifications for notifications that don't have the type "critical" or "question".

Why not simply a button "Don't show this kind of notifications again" similar to what we have in the popup?

  • Due to a Chrome limitation this button should also not be added to notifications that specify more than two links.

We should keep this in mind, and never use this type of notifcation if we have more than a single link. But in case we forget about this, I think it would be preferable to have the opt-out rather than the second link in there. After all the 3rd, 4th, etc. link will be missing anyway.

comment:2 in reply to: ↑ 1 ; follow-up: Changed on 09/08/2015 at 05:28:25 PM by greiner

  • Cc sven added

Replying to sebastian:

Why not simply a button "Don't show this kind of notifications again" similar to what we have in the popup?

Currently, there's no way to opt-out of such notifications with a single click. I discussed this with Sven and that turned out to be the a good way to provide a simple way to opt-out without overly encouraging it.

We should keep this in mind, and never use this type of notifcation if we have more than a single link. But in case we forget about this, I think it would be preferable to have the opt-out rather than the second link in there. After all the 3rd, 4th, etc. link will be missing anyway.

Right, we should always keep such limitations in mind - especially since desktop notifications are also restricting the text length of messages we can show. But since we should never have more than one call-to-action, this is more of an edge-case scenario anyway.

How about falling back to the approach we use with standard desktop notifications: Adding a button that opens all links at once (in case there are more than one link). Thereby we would always be able to show the opt-out button.
That may actually be an even better approach than the suggested one in the description.

comment:3 in reply to: ↑ 2 Changed on 09/08/2015 at 05:38:06 PM by sebastian

Replying to greiner:

Replying to sebastian:

Why not simply a button "Don't show this kind of notifications again" similar to what we have in the popup?

Currently, there's no way to opt-out of such notifications with a single click. I discussed this with Sven and that turned out to be the a good way to provide a simple way to opt-out without overly encouraging it.

IIRC, the opt-out was per category and categories are independent of notification types. So as far as I understand it, it should work (or at least we should make it work) the same for "information" and "normal" notifications.

How about falling back to the approach we use with standard desktop notifications: Adding a button that opens all links at once (in case there are more than one link). Thereby we would always be able to show the opt-out button.
That may actually be an even better approach than the suggested one in the description.

Agreed.

comment:4 Changed on 09/09/2015 at 11:32:29 AM by greiner

  • Description modified (diff)

Replying to sebastian:

IIRC, the opt-out was per category and categories are independent of notification types. So as far as I understand it, it should work (or at least we should make it work) the same for "information" and "normal" notifications.

Notification categories are not implemented yet. So far we've only gotten around adding a global opt-out (see #2191). Therefore the outcome would be the same.

Also as soon as we do implement categories, the options page is supposed to provide ways to en-/disable each of those individually so this approach appears to be future-proof.

comment:5 Changed on 09/09/2015 at 12:28:19 PM by sebastian

  • Priority changed from Unknown to P2
  • Ready set

comment:6 Changed on 09/10/2015 at 02:45:26 PM by greiner

  • Owner set to greiner

comment:7 Changed on 09/10/2015 at 06:56:42 PM by greiner

  • Review URL(s) modified (diff)
  • Status changed from new to reviewing

comment:8 Changed on 09/11/2015 at 12:45:42 PM by greiner

  • Description modified (diff)

comment:9 Changed on 09/11/2015 at 06:48:13 PM by greiner

  • Milestone set to Adblock-Plus-for-Chrome-Opera-Safari-next
  • Resolution set to fixed
  • Status changed from reviewing to closed

comment:10 Changed on 09/18/2015 at 07:44:23 PM by Ross

  • Tester changed from Unknown to Ross

When testing this I noticed the browsers all treated notifications differently. So here is a table of behaviour for reference. One of the biggest differences is that you can't click the desktop notification Safari shows (like Opera, Chrome) - You have to go into the notification tray and click there. Another is that Opera does not show the buttons, it just detects links and appends a string (like Safari), difference here you can click the desktop notification.

To get back to the ticket: The "opt-out" configure notification button on desktop notifications works as described, but only in Chrome itself.

Chrome (45.0.2454.93):
All variations work as described.

Opera (32.0.1948.25):

CriticalNo linksAs described, no buttons.
Critical1+ links"Click on the notification to open all links in it" appended. Clicking desktop notification opens links.
Question:-Pops up in the middle of the screen with Yes/No buttons.
NormalNo linksAppears but the configuration button is not present.
Normal1+ links"Click on the notification to open all links in it" appended. Clicking desktop notification opens links. Configuration button not present.

Links in notification in ABP UI work fine

Safari (7.0.6)

CriticalNo linksAs described + Notification is placed into the OS notification area on the right. If closed in the OS notification area it is also removed from the ABP popup UI. If closed in the ABP popup UI, it remains in the OS notification area until closed there.
Critical1+ linksAs row above + "Click on the notification to open all links in it" appended. Clicking desktop notification does not open links. Have to click notification in OS notification area to opens links
Question:-Pops up in the middle of the screen with OK/Cancel buttons
NormalNo linksAs described + Notification is placed into the OS notification area on the right. Configuration button is not present
Normal1+ linksAs row above + "Click on the notification to open all links in it" appended. Clicking desktop notification does not open links. Have to click notification in OS notification area to opens links Configuration button not present

Links in notification in ABP UI work fine

comment:11 Changed on 09/21/2015 at 09:54:22 AM by greiner

Note that this ticket only affects Chrome due to its slightly enhanced notification capabilities. In browsers that don't support those we fall back to a regular Web Notification or a basic confirm() dialog for question-type notifications since those require two buttons.

Regarding the OSX notification area issue: I'm not sure whether the described behavior is a regression or whether it has always been like that. In any case, it might be worth investigating. Apart from that, however, the results look fine.

Add Comment

Modify Ticket

Change Properties
Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from greiner.
 
Note: See TracTickets for help on using tickets.