html
html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<h3>navigator.vibrate() now requires user auth...just like audio. It appears you can't catch the error (?)</h3>
<h4>Console<br />Blocked call to navigator.vibrate because user hasn't tapped on the frame or any embedded frame yet:</h4> <a href="https://www.chromestatus.com/feature/5644273861001216">https://www.chromestatus.com/feature/5644273861001216</a> [Remove navigator.vibrate without user gesture]
<script>
var oeFired=false;
var tryFired=false;
window.onerror=function(){
oeFired=true;
alert("cancelling error")
return true;
}
if(navigator.vibrate)
try{
navigator.vibrate(75);
} catch (e){
tryFired=true;
alert('try..caught error');
} finally {
if(!(oeFired || tryFired))
alert("Did not catch error.")
Enter to Rename, Shift+Enter to Preview
css
css
1
h4 {color:crimson;}
Enter to Rename, Shift+Enter to Preview
js
js
1
Enter to Rename, Shift+Enter to Preview
BROWSER
Console
Run