content/base/test/file_bug622088_inner.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/content/base/test/file_bug622088_inner.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,38 @@
     1.4 +<!DOCTYPE HTML>
     1.5 +<html>
     1.6 +<head>
     1.7 +<script>
     1.8 +function load() {
     1.9 +  (window.opener || window.parent).innerLoaded(window);
    1.10 +}
    1.11 +
    1.12 +function doXHR(req) {
    1.13 +  // Do a sync XHR and return the XHR's referrer.
    1.14 +  if (!req) {
    1.15 +    req = new XMLHttpRequest();
    1.16 +  }
    1.17 +
    1.18 +  // file_bug622088.sjs echos its referrer back to us.  We need to refer to it
    1.19 +  // using an absolute URI because we sometimes pass in |req| from a window
    1.20 +  // which has a data: URI.  In that case, a relative path would not get
    1.21 +  // resolved properly!
    1.22 +  //
    1.23 +  // Resolve our relative URI to an absolute one by creating an anchor element
    1.24 +  // and reading its href property.
    1.25 +  var anchor = document.createElement('a');
    1.26 +  anchor.href = 'file_bug622088.sjs';
    1.27 +
    1.28 +  dump('anchor.href=' + anchor.href + '\n');
    1.29 +
    1.30 +  req.open('GET', anchor.href, false);
    1.31 +  req.send(null);
    1.32 +  return req.responseText;
    1.33 +}
    1.34 +</script>
    1.35 +</head>
    1.36 +
    1.37 +<body onload='load()'>
    1.38 +<!--Inner frame target for test_bug622088_2.html. -->
    1.39 +</body>
    1.40 +
    1.41 +</html>

mercurial