forked from mdn/sw-test
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cross.html
19 lines (17 loc) · 832 Bytes
/
cross.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<!DOCTYPE html>
<script>
var queryString = location.search;
if (queryString && queryString.charAt(0) === '?') {
// Cross-Origin fetch with a custom header.
console.log("################################ cross.html trying fetch");
//fetch(queryString.substring(1)+"foo.html", {headers: {'X-Custom-Header2':'foobar'}});
fetch(new Request(queryString.substring(1)+"service_worker/cross_site_xfer_scope/cross_site_xfer_confirm_via_serviceworker.html",
{headers: {'X-Custom-Header2':'foobar'}})).then(function(data) {
console.log("fetch returned "+ data);
});
} else {
console.log("################################ cross.html trying fetch2");
fetch("https://www.wikipedia.org/portal/wikipedia.org/assets/img/[email protected]",
{headers: {'X-Custom-Header2':'foobar'}});
}
</script>