With a recent change in Chrome 60, window.navigator.vibrate
returns false
in cross-origin i-frames, and doesn't vibrate until a user gesture is executed in that window. Is there a way to attach a listener to a window to see when this feature is enabled so I can just avoid calling vibrate
until this permission is allowed?
Currently if you try running the function, it will spit out an error in the console and constantly do so until you interact with the window.
An example of the output that's printed to console that I want to avoid:
[Intervention] Blocked call to navigator.vibrate because user hasn't tapped on the frame or any embedded frame yet: https://www.chromestatus.com/feature/5644273861001216