summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/fetch/security/support/embedded-credential-window.sub.html
blob: 20d307e9188405dcec011042487aa2c7354930bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<!DOCTYPE html>
<script>
  window.addEventListener("message", e => {
    var i = document.createElement('img');
    i.onload = () => { e.ports[0].postMessage("Load"); }
    i.onerror = () => { e.ports[0].postMessage("Error"); }
    if (e.data == "relative") {
      i.src = "/images/green.png";
    } else if (e.data == "same-origin-matching") {
      i.src = "http://user:pass@{{domains[www]}}:{{ports[http][0]}}/images/green.png";
    } else if (e.data == "cross-origin-matching") {
      i.src = "http://user:pass@{{domains[élève]}}:{{ports[http][0]}}/images/red.png";
    } else {
      i.src = "http://user:pass@{{domains[www]}}:{{ports[http][0]}}/images/red.png";
    }
  });

  (window.opener || window.parent).postMessage("Hi!", "*");
</script>