1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17

content / test / data / service_worker / fetch_cross_origin.html [blame]

<!DOCTYPE html>
<html>
<head>
<title>INITIAL</title>
<script>
var queryString = location.search;

if (queryString && queryString.charAt(0) === '?') {
  // Fetches the URL provided in query string with a custom header.
  fetch(queryString.substring(1), {headers: {'X-Custom-Header': 'foo'}})
    .then(data => data.text())
    .then(text => document.title = text)
    .catch(() => document.title = 'FAIL');
}
</script>
</head>
</html>