summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/service-workers/service-worker/resources/fetch-request-resources-iframe.https.html
blob: 86e9f4bb3598a5951920d13e1e002d78fe0aa21e (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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<script src="test-helpers.sub.js?pipe=sub"></script>
<body>
<script>

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

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

function load_css(url, cross_origin) {
  const 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) {
  const fontFace = new FontFace('test', 'url(' + url + ')');
  fontFace.load();
}

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

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

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

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

function load_audio(url, cross_origin) {
  const audio = document.createElement('audio');
  if (cross_origin != '') {
    audio.crossOrigin = cross_origin;
  }
  audio.src = url;
  document.body.appendChild(audio);
}

function load_video(url, cross_origin) {
  const video = document.createElement('video');
  if (cross_origin != '') {
    video.crossOrigin = cross_origin;
  }
  video.src = url;
  document.body.appendChild(video);
}
</script>
</body>