tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

cancel-with-0-manual.html (1109B)


      1 <!DOCTYPE html>
      2 <html>
      3  <head>
      4    <meta charset='utf-8'/>
      5    <title>Vibration API: cancel ongoing vibrate() with 0</title>
      6    <link rel='author' title='Robin Berjon' href='mailto:robin@berjon.com'/>
      7    <link rel='help' href='http://www.w3.org/TR/vibration/#methods'/>
      8    <meta name='flags' content='dom, interact'/>
      9    <meta name='assert' content='If pattern is 0, cancel the pre-existing instance of the processing vibration patterns algorithm'/>
     10  </head>
     11  <body>
     12    <h1>Description</h1>
     13    <p>
     14      After hitting the button below, your device must vibrate for a short period of time (roughly one
     15      second). If it vibrates for a longer time (roughly five seconds, it should feel somewhat long) then
     16      the test has failed.
     17    </p>
     18    <button id='vib'>Vibrate!</button>
     19    <script>
     20      if (undefined !== navigator.vibrate) {
     21          document.getElementById("vib").onclick = function () {
     22              navigator.vibrate(5000);
     23              setTimeout(function () {
     24                  navigator.vibrate(0);
     25              }, 1000);
     26          };
     27      }
     28    </script>
     29  </body>
     30 </html>