tor-browser

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

windowTest.html (1006B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <!--
      4 https://bugzilla.mozilla.org/show_bug.cgi?id=493615
      5 -->
      6 <head>
      7  <title>Test for closing a window while it is doing a geolocation request </title>
      8  <script src="/tests/SimpleTest/SimpleTest.js"></script>
      9  <script type="text/javascript" src="geolocation_common.js"></script>
     10 
     11 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
     12 </head>
     13 <body>
     14 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=493615">Mozilla Bug 493615</a>
     15 <p id="display"></p>
     16 <div id="content" style="display: none">
     17 
     18 </div>
     19 <pre id="test">
     20 <script class="testbody" type="text/javascript">
     21 "use strict";
     22 
     23 var finished = false;
     24 
     25 function successCallback(position) {
     26  check_geolocation(position);
     27 
     28  // watchPosition can notify more than once.
     29  if (finished) {
     30    return;
     31  }
     32  finished = true;
     33 
     34  var opener = window.opener;
     35  window.close();
     36  opener.done();
     37 }
     38 
     39 navigator.geolocation.watchPosition(successCallback, null, null);
     40 </script>
     41 </pre>
     42 </body>
     43 </html>