New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.
Starred by 14 users
Status: WontFix
Owner: ----
Closed: Jul 2010
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug

Restricted
  • Only users with Commit permission may comment.



Sign in to add a comment
Desktop Notifications permission request does not work from within the console
Project Member Reported by phistuck@gmail.com, Jan 7 2010 Back to list
Chrome Version       : 4.0.266.0\4.0.288.1
URLs (if applicable) : any, try www.google.com.

What steps will reproduce the problem?
1. Go to the Developer Tools on some page.
2. In the console, type -
webkitNotifications.requestPermission(function(){alert("The permission was 
given.")})

What is the expected result?
A permission request infobar will show.

What happens instead?
Nothing happens.
 
Labels: -Area-Undefined WebKit-DevTools OS-Windows
Status: Untriaged
Comment 2 by phistuck@gmail.com, Jan 7 2010
Note that it does work when you type it as -
javascript:void(webkitNotifications.requestPermission(function(){alert("The permission was 
given.")}))
In the Omnibox, which should be interchangeable, I believe.
Labels: -WebKit-DevTools Feature-Notifications
Summary: Request a Desktop Notification permission does not show (renders the feature unusable) (was: NULL)
Update - this is not working everywhere (Developer Tools, web pages, extension pages). 
Only through the location bar.
Summary: Request a Desktop Notification permission info bar does not show (renders the feature unusable) (was: NULL)
I have noticed that is not working only in console, if you call request permission in 
source-code will work.

eg: onclick="Reqfunc()" or onclick="webkitNotifications.requestPermission()" = Work!

if you call Reqfunc() in console will not work too.
Labels: WebKit-DevTools
Summary: Desktop Notifications permission request does not work from within the console (was: NULL)
Oh, then this is by design, according to  Issue 27215 .
But, the fact that it does not work from the DevTools console and does work from the 
omnibox is an inconsistency.
Reverting back to the original summary.
Labels: Area-DevTools
Labels: -webkit-devtools Feature-DevTools
Labels: Area-Feature
I don't understand the purpose of this notification API in the light of  issue 27215 .

If notifications permission alerts are only displayed as a response to a user action, 
why the need to call requirePermission? The browser could automatically show it for the 
first time. Is it only to ensure that user code can still run while waiting for the 
permission?

In any case, it doesn't seem to be too programmer-friendly.
The point is to prevent unwanted infobars; this is why it can only appear on a user
gesture.

Since createNotification().show() can be done without user gesture, requesting
permission on first use would also create an unwanted infobar.
Labels: -Area-Feature Area-UI
Comment 13 by nav...@gmail.com, Apr 29 2010
Not a Bug, Feature.

Desktop Notifications can only be triggered via a user action.  Typing into the 
JavaScript console has the same effect as raw javascript code embedded into the web 
page (no user action).  Typing the javascript into the location bar, however, 
represents a user-action (the user is intentionally visiting a javascript link to 
enable notifications, probably for sites that tend to use href="javascript:" instead 
of onclick="".

I'm pretty sure this is a non-issue.
Comment 14 by kerz@chromium.org, Jul 9 2010
Labels: -Area-DevTools Area-WebKit
Comment 15 by karen@chromium.org, Jul 12 2010
Labels: Mstone-X
Status: WontFix
Closing per comment #13.
Comment 17 by agi...@gmail.com, Mar 30 2011
My chrome had been updated to 10.0.648.204, but it still doesn't work with code in javascript(It doesn't change anything, so my code won't run downstairs). Only change "Notifications" in "Options" - "Content Settings" manual.

And webkitNotifications.requestPermission(function(){alert("The permission was given.")}) doesn't work anymore, untill run in location with "javascript:..." but also didn't change settings.
Comment 18 by agi...@gmail.com, Mar 31 2011
Comment 13´╝îgreat, it works!
Project Member Comment 19 by bugdroid1@chromium.org, Oct 12 2012
Labels: Restrict-AddIssueComment-Commit
This issue has been closed for some time. No one will pay attention to new comments.
If you are seeing this bug or have new data, please click New Issue to start a new bug.
Project Member Comment 20 by bugdroid1@chromium.org, Mar 11 2013
Labels: -Feature-Notifications -Area-WebKit -Feature-DevTools -Area-UI Cr-Content Cr-UI-Notifications Cr-UI Cr-Platform-DevTools
Project Member Comment 21 by bugdroid1@chromium.org, Apr 6 2013
Labels: -Cr-Content Cr-Blink
Sign in to add a comment