New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 621529 link

Starred by 4 users

Issue metadata

Status: Archived
Owner:
Closed: Sep 19
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

Regression: Notifications are broken

Reported by k...@luminance.org, Jun 20 2016

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:49.0) Gecko/20100101 Firefox/49.0

Steps to reproduce the problem:
1. Attempt to display a notification - for example, from an extension with the notifications permission:
1a. Open extension settings
1b. Turn on developer mode
1c. Inspect the extension's background view
1d. Run the following code in the developer console:

  chrome.notifications.create({type: "basic", title: "Test notification", message: "Test notification message", iconUrl: "<valid_image_url>"})

1e. The above iconUrl must be a valid image url contained within the extension because Chrome refuses to display notifications without an image, and refuses to use blank images or images from external domains.

What is the expected behavior?
Invalid attempts to show a notification should fail.
Valid attempts to show a notification should succeed if notifications are enabled & the extension has the relevant permission grant.

What went wrong?
Invalid attempts to show a notification do fail with the correct error messages.
Valid attempts to show a notification silently fail. chrome.runtime.lastError is not set.

Did this work before? Yes Maybe a week ago

Chrome version: Version 51.0.2704.103 m  Channel: stable
OS Version: 10.0
Flash Version: Shockwave Flash 21.0 r0

One of my followers reports that notifications are also broken for web pages:
https://mobile.twitter.com/wavebeem/status/744905619317096448
 
This also occurs when using the `new Notification(title, options)` API on macOS. I was able to find a workaround by enabling Native Notifications in chrome://flags, which seemed to be off by default.
Components: -UI UI>Notifications

Comment 3 by peter@chromium.org, Jun 22 2016

Labels: Needs-Feedback
Native notifications won't work for extensions yet, so please be aware of that when considering the work-around.

Would you have an example webpage or extension we can take a look at? A number of tests I did seem to work just fine. Are you running Chrome in fullscreen mode by any chance?
Peter:

To be clear, in my case I'm *not* talking about extension code, just a basic website. You should be able to run this code, click allow on the permissions dialog, and on any website observe the notification *not* being created. I'm running macOS, and this happens on latest stable Chrome and Chrome canary.

Notification.requestPermission()
  .then(res => {
    if (res === "granted") {
      console.log("notify");
      new Notification("nice");
    }
  })
Based on my workaround, I'm wondering if this is related to Chrome's custom notification center implementation? I swear I remember asking Chrome to hide that at some point, because I didn't want the notification icon in my menu bar. So maybe Chrome is in a state where it's trying to send a non-native notification but the non-native notification center doesn't exist?

Comment 6 by peter@chromium.org, Jun 22 2016

I uploaded it to jsbin here:

http://jsbin.com/qeradomeho/edit?html,js,output

It works for me on both Stable (51) and Canary (53) on Mac OS X 10.11.5. Which version of Mac OS X are you using? Are you using Chrome in Incognito mode?

Comment 7 by peter@chromium.org, Jun 22 2016

We still use our own notification toasts, but the notification center itself (which displayed the icon in the system tray) has been removed from the non-Chrome OS platforms.

Quiet mode is not persistent. It could be one of the blockers (screen locked or in full-screen), or Incognito mode where we don't support them; hence my questions.
This is failing for me on:

macOS 10.11.5
MacBook Pro (retina, 15", mid-2015)

Chrome Stable: Version 51.0.2704.103 (64-bit)
Chrome Canary: Version 53.0.2774.3 canary (64-bit)

This is also failing for me on my personal Mac at home. I can't tell you its version numbers until I get home today.

I'm not using Chrome in Incognito mode. The issue occurs regardless of fullscreen state (Command-Control-F).

In Chrome Stable I have not modified anything in chrome://flags. I have a few flags on in Canary.

Enabling chrome://flags/#enable-native-notifications in Chrome Stable fixes the issue. Interestingly, I noticed that with this flag OFF, on Chrome Stable, I get a BRIEF flash of notification sometimes. It's about 50-100ms at most, and it's almost transparent.

Is there any additional information I can supply to help?

Comment 9 by k...@luminance.org, Jun 22 2016

Peter:

You can run this in the developer console:
chrome.notifications.create({type: "basic", title: "Test notification", message: "Test notification message", iconUrl: "../../icons/active-128.png"})
using this extension:
https://chrome.google.com/webstore/detail/viramate/fgpokpknehglcioijejfeebigdnbnokj?hl=en-US&gl=US&authuser=0

You won't need to visit any particular website, just execute it in the context of the background page.

I haven't changed any notification related settings on my end (and as I'm on Windows, there's no native notifications flag to set/unset). I tried turning notifications off and then back on in the Chrome settings just to be sure and that didn't work either.

The jsbin above (http://jsbin.com/qeradomeho/edit?html,js,output) also does not work for me. The 'notify' message appears in the console but no notification appears.

Comment 10 by k...@luminance.org, Jun 22 2016

I just found a workaround on my Windows machine: If I disable my secondary monitor, attempting to summon a new notification (using the above code) causes every broken notification that ever failed to begin opening, 3 at a time.

Incidentally, Firefox is broken the same way, so I'll have to file a bug report with them too.
To clarify my environment, I have tried a two-display setup and a one-display setup and it occurs in both. I have not tried going between setups yet as described.
That makes it sound like there is a problem with a NotificationBlocker on your system.  The only ones active on Mac and Windows are FullscreenNotificationBlocker and ScreenLockNotificationBlocker if my code searches are correct.  Maybe one of those is interacting poorly with your multi-screen setup.

Comment 13 by k...@luminance.org, Jun 22 2016

Entering fullscreen mode in MPC-HC on my other monitor does break notifications on both monitors in the same way it was broken before, but that only persists until the media player is returned to windowed mode. Good to know about that, and that's undesirable, but I don't think I had a media player in fullscreen earlier when testing this problem.

The way Chrome handles notifications with a blocker active is generally unfortunate. There's no feedback that the notification failed, and it won't appear as soon as the blocker goes away - you need to fire a new notification first. Should I file a separate bug about addressing that?
I can confirm that taking Chrome Canary (Version 51.0.2704.103 (64-bit)) out of fullscreen (Command-Control-F) makes the non-native notifications start working again. But my stable Chrome (Version 51.0.2704.103 (64-bit)) seems broken in either state.

I made every single other Mac application not-fullscreen for testing purposes.
NotificationBlockers are supposed to stop blocking as soon as the condition changes, not when a new notification arrives.  If that's still the case there is another bug lurking, where we may not receive the proper signal that fullscreen has changed.
Cc: durga.behera@chromium.org
Labels: M-53
Unable to reproduce the issue on Win 7,Mac 10.11.5(MacBook Air& Retina)and Ubuntu 14.04 using stable 51.0.2704.103 and canary 53.0.2776.0.
Could you please review the attached screen cast if anything is missed here.
621529_June_23.mp4
597 KB View Download

Comment 17 by k...@luminance.org, Jun 23 2016

@16 The 'wants to show notifications' popup is not a web notification. In one of my tests I got the prompt asking for a permission grant, but then never actually got notifications after granting. So you should go through the actual test and make sure a notification appears.
Thanks for the quick update.
Observing the attached behaviour since 49.0.2623.112 till now on a Win 7 machine, could you please let us know the expected output for this to further investigate it.
621529_C18.png
98.7 KB View Download
Project Member

Comment 19 by sheriffbot@chromium.org, Jun 23 2016

Labels: -Needs-Feedback Needs-Review
Owner: peter@chromium.org
Thank you for providing more feedback. Adding requester "peter@chromium.org" for another review and adding "Needs-Review" label for tracking.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Comment 20 by k...@luminance.org, Jun 23 2016

@18
Using the extension I suggested, you will want to run:
chrome.notifications.create({type: "basic", title: "Test notification", message: "Test notification message", iconUrl: "../../icons/active-128.png"})
Please let me know if there is any more information I can provide for this ticket, or if there is any debugging program I can use to collect logs to help diagnose the problem.
Project Member

Comment 22 by sheriffbot@chromium.org, Jul 4 2016

Labels: -M-53 M-54 MovedFrom-53
Moving this nonessential bug to the next milestone.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Comment 23 by k...@luminance.org, Jul 14 2016

Chrome notifications are broken on my Windows machine again, same as before. It seems convinced that I am in fullscreen mode, but I am not.

Interestingly, notifications in the LINE instant messaging client are suppressed if I have its 'disable notifications while in fullscreen' option turned on as well right now. I believe it uses QT. LINE is actually how I realized Chrome notifications were broken - it was mysteriously not notifying me about messages, and again I hadn't realized that Chrome was silently suppressing notifications. :(

Is there any diagnostic information I can get you? Are there any tests/experiments I can run to identify what's going on here?

Comment 24 by k...@luminance.org, Jul 14 2016

I did a manual test and SHQueryNotificationState appears to be yielding 'QUNS_RUNNING_D3D_FULL_SCREEN', for some reason. I am not currently in exclusive full-screen, but I was a few hours ago. This state bit appears to have become 'stuck' on my machine. When I terminated the process for the application that was once in exclusive fullscreen mode, the SHQueryNotificationState changed to the expected 'QUNS_ACCEPTS_NOTIFICATIONS', and once I triggered a new Chrome notification manually, all the pending ones appeared (3 at a time).

So SHQueryNotificationState appears to be misbehaving here - or at least not behaving in a desirable way, but Chrome is also not responding appropriately when the notification state changes.

Based on this I would wonder whether it is actually appropriate to silence notifications as long as RUNNING_D3D_FULL_SCREEN is being returned, since its implementation seems to be 'has any running process ever entered exclusive fullscreen mode'. This could result in notifications being mysteriously silenced for a user for hours at a time.
Status: (was: Unconfirmed)
Status: Assigned
Labels: -Needs-Review
Cleaning up "Needs-Review" label as we are not using this label for triage anymore. Ref bug for this cleanup 684919
Status: Archived (was: Assigned)
Archiving old bugs that have only received trivial updates for some time.

If you feel this issue should still be addressed, feel free to reopen it or to file a new issue. Thanks!
This was assigned two years ago and never updated since. Were notifications fixed? I don't know because I gave up on them working. At last update it was clearly a combination of OS bug + Chrome bug.
The snippets I mentioned above still fail for me (Chrome 69, macOS 10.13.6)
Strangely enough, I made a new Chrome profile to test the issue and it started working! Then going back to my old Chrome profile it started working there too. I have no idea what has changed here.

Sign in to add a comment