content/base/test/file_bug622088_inner.html

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

michael@0 1 <!DOCTYPE HTML>
michael@0 2 <html>
michael@0 3 <head>
michael@0 4 <script>
michael@0 5 function load() {
michael@0 6 (window.opener || window.parent).innerLoaded(window);
michael@0 7 }
michael@0 8
michael@0 9 function doXHR(req) {
michael@0 10 // Do a sync XHR and return the XHR's referrer.
michael@0 11 if (!req) {
michael@0 12 req = new XMLHttpRequest();
michael@0 13 }
michael@0 14
michael@0 15 // file_bug622088.sjs echos its referrer back to us. We need to refer to it
michael@0 16 // using an absolute URI because we sometimes pass in |req| from a window
michael@0 17 // which has a data: URI. In that case, a relative path would not get
michael@0 18 // resolved properly!
michael@0 19 //
michael@0 20 // Resolve our relative URI to an absolute one by creating an anchor element
michael@0 21 // and reading its href property.
michael@0 22 var anchor = document.createElement('a');
michael@0 23 anchor.href = 'file_bug622088.sjs';
michael@0 24
michael@0 25 dump('anchor.href=' + anchor.href + '\n');
michael@0 26
michael@0 27 req.open('GET', anchor.href, false);
michael@0 28 req.send(null);
michael@0 29 return req.responseText;
michael@0 30 }
michael@0 31 </script>
michael@0 32 </head>
michael@0 33
michael@0 34 <body onload='load()'>
michael@0 35 <!--Inner frame target for test_bug622088_2.html. -->
michael@0 36 </body>
michael@0 37
michael@0 38 </html>

mercurial