Navigator.requestPermission is called in response to a user gesture, but Chrome does not detect this
Reported by
benl...@gmail.com,
Jun 20 2017
|
|||||
Issue descriptionUserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36 Steps to reproduce the problem: 1. Load the example HTML in Chrome (via file://) 2. Open the dev console 3. Click "Request permission directly". Note that there is no warning in the console. Dismiss the permission prompt (click the X). 4. Click "Request permission in a Promise chain". Note the warning "[Violation] Only request notification permission in response to a user gesture" What is the expected behavior? If the Promise chain is started by code executed in response to a user gesture, then it should be possible to execute Notification.requestPermission in that chain. What went wrong? In our code, clicking a button to subscribe calls a function that returns a Promise chain, in which we check for the existence of a service worker, and verify that the worker is active and ready before we call requestPermission. We see the Violation warning when requestPermission is called, even though the call is made in a Promise chain resulting from a gesture, and the delay before the call is short. In the test case above, I delayed more than 1000mS after the click to cause the violation. In our production code, we see the violation even though fewer than 1000mS typically pass before we call requestPermission. Did this work before? N/A Chrome version: 58.0.3029.110 Channel: n/a OS Version: OS X 10.12.5 Flash Version: We appreciate that detecting what is done in response to a user gesture is complex. However, we think it's reasonable that when a Promise chain starts in the handling of an gesture event, that calls made in that chain are considered to be made in response to that gesture.
,
Jul 4 2017
I'm not sure that the component has been set correctly on this issue. It is not associated with DevTools, nor is it necessarily Mac-specific.
,
Jul 5 2017
Unable to reproduce the issue in MacBook Pro (Retina, 15-inch, Mid 2014), 10.12.5 using latest chrome stable #59.0.3071.115 and latest canary #61.0.3149.0. Following are the steps followed to reproduce the issue. ------------ 1. Loaded the attached HTML file in Chrome. 2. Opened the dev console. 3. Clicked "Request permission directly" and dismissed the permission prompt by clicking on "x". Observed default in the console. 4. Clicked "Request permission in a Promise chain" and on dismissing the permission prompt by clicking on "x" observed undefined in the console. Also on clicking the allow button returned the same. Attaching screen cast for reference. benlast@ - Could you please verify the screen cast and please let us know if anything missed from our side. Also please check this issue on latest chrome stable #59.0.3071.115 by creating a new profile without any apps and extensions and please let us know if the issue still persist or not. Thanks...!!
,
Jul 5 2017
krajshree@ - The attached screen shot from your screencast shows that the Violation warning is appearing in your console but is hidden, because you have your console filtering set to Info. If you set it to Verbose you will see the Violation warning when you click on "Request permission in a Promise chain".
,
Jul 5 2017
...and I retested just now on Version 59.0.3071.115 (Official Build) (64-bit) and got the reported behaviour.
,
Jul 6 2017
This seems closely related to our ongoing gesture cleanup work. From the description, it looks like a crack in our existing UGI code. I will investigate it soon.
,
Aug 3 2017
,
Nov 1 2017
,
Jan 7
mustaq@ where are we on this one? |
|||||
►
Sign in to add a comment |
|||||
Comment 1 by ccameron@chromium.org
, Jun 27 2017Labels: -OS-Mac