summaryrefslogtreecommitdiffstats
path: root/dom/security/test/csp/file_main.js
blob: 01dd43cbf5a6984d859e8fe171ce6b95e315867e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
function doXHR(uri) {
  try {
    var xhr = new XMLHttpRequest();
    xhr.open("GET", uri);
    xhr.send();
  } catch (ex) {}
}

doXHR(
  "http://mochi.test:8888/tests/dom/security/test/csp/file_CSP.sjs?testid=xhr_good"
);
doXHR(
  "http://example.com/tests/dom/security/test/csp/file_CSP.sjs?testid=xhr_bad"
);
fetch(
  "http://mochi.test:8888/tests/dom/security/test/csp/file_CSP.sjs?testid=fetch_good"
);
fetch(
  "http://example.com/tests/dom/security/test/csp/file_CSP.sjs?testid=fetch_bad"
);
navigator.sendBeacon(
  "http://mochi.test:8888/tests/dom/security/test/csp/file_CSP.sjs?testid=beacon_good"
);
navigator.sendBeacon(
  "http://example.com/tests/dom/security/test/csp/file_CSP.sjs?testid=beacon_bad"
);