summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/service-workers/service-worker/resources/fetch-request-resources-iframe.https.html
blob: 93b038dd67c590b5011e0bded4ce5dab338f25fa (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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<script src="test-helpers.sub.js?pipe=sub"></script>
<body>
<script>

function load_image(url, cross_origin) {
  var img = document.createElement('img');
  if (cross_origin != '') {
    img.crossOrigin = cross_origin;
  }
  img.src = url;
}

function load_script(url, cross_origin) {
  var script = document.createElement('script');
  script.src = url;
  if (cross_origin != '') {
    script.crossOrigin = cross_origin;
  }
  document.body.appendChild(script);
}

function load_css(url, cross_origin) {
  var link = document.createElement('link');
  link.rel = 'stylesheet'
  link.href = url;
  link.type = 'text/css';
  if (cross_origin != '') {
    link.crossOrigin = cross_origin;
  }
  document.body.appendChild(link);
}

function load_font(url) {
  var fontFace = new FontFace('test', 'url(' + url + ')');
  fontFace.load();
}

function load_css_image(url, type) {
  var div = document.createElement('div');
  document.body.appendChild(div);
  div.style[type] = 'url(' + url + ')';
}

function load_css_image_set(url, type) {
  var div = document.createElement('div');
  document.body.appendChild(div);
  div.style[type] = '-webkit-image-set(url(' + url + ') 1x)';
}

function load_script_with_integrity(url, integrity) {
  var script = document.createElement('script');
  script.src = url;
  script.integrity = integrity;
  document.body.appendChild(script);
}

function load_css_with_integrity(url, integrity) {
  var link = document.createElement('link');
  link.rel = 'stylesheet'
  link.href = url;
  link.type = 'text/css';
  link.integrity = integrity;
  document.body.appendChild(link);
}

</script>
</body>