Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#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

Change History (11)

comment:1 in reply to: ↑ description ; follow-up: Changed 4 years ago 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 4 years ago 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 4 years ago 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 4 years ago 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 4 years ago by sebastian

  • Priority changed from Unknown to P2
  • Ready set

comment:6 Changed 4 years ago by greiner

  • Owner set to greiner

comment:7 Changed 4 years ago by greiner

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

comment:8 Changed 4 years ago by greiner

  • Description modified (diff)

comment:9 Changed 4 years ago 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 4 years ago 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 4 years ago 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.

Note: See TracTickets for help on using tickets.