tor-browser

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

file_triggeringprincipal_subframe_same_origin_nav.html (721B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <head><meta charset="utf-8"></head>
      4 <body onload="checkResults()">
      5 <b>SubFrame Same-Origin Navigated</b><br/>
      6 
      7 <script type='application/javascript'>
      8  function checkResults() {
      9    // query the uri of the loadingPrincipal and the TriggeringPrincipal and pass
     10    // that information on to the parent for verification.
     11    var channel = SpecialPowers.wrap(window).docShell.currentDocumentChannel;
     12    var triggeringPrincipalURI = channel.loadInfo.triggeringPrincipal.asciiSpec;
     13    var loadingPrincipalURI = channel.loadInfo.loadingPrincipal.asciiSpec;
     14 
     15    window.parent.postMessage({triggeringPrincipalURI,
     16                               loadingPrincipalURI}, "*");
     17  }
     18 </script>
     19 </body>
     20 </html>