forked from mdn/sw-test
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathresource-timing.html
76 lines (61 loc) · 2.27 KB
/
resource-timing.html
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
<!DOCTYPE html>
<html>
<head>
<script>
function dump_resource_timing() {
var resources = performance.getEntriesByType("resource");
if (resources === undefined || resources.length <= 0) {
console.log("there are NO `resource` performance records");
return;
}
resources.forEach((entry) => {
console.log(entry.name, entry.transferSize, entry.decodedBodySize, entry.entryType);
console.log(entry);
});
}
</script>
</head>
<body onload='console.log("onload document"); dump_resource_timing();'>
<br><br><br>
<button onclick="dump_resource_timing()">Dump ResourceTiming</button>
<br><br><br>
<h2>Images with dimensions</h2>
<img width="100" height="60" src="../img/pic_trulli.jpg" onload='console.log("onload with dimensions")'>
<br>
<img loading="lazy" width="100" height="60" src="../img/img_chania.jpg" onload='console.log("onload with dimensions loading=lazy")'>
<br>
<img loading="eager" width="100" height="60" src="../img/Chrome__logo.max-200x200.png"
onload='console.log("onload with dimensions loading=eager")'>
<br>
<h2>Images with no dimensions</h2>
<img src="../img/img_orange_flowers.jpg"
onload='console.log("onload auto")'>
<br>
<img loading="lazy" src="../img/images.jpeg"
onload='console.log("onload lazy")'>
<br>
<img loading="eager" src="../img/180523094407-tesla-trouble-custom-1.jpg"
onload='console.log("onload eager")'>
<br>
<h2>Scroll down for the deferred images to be loaded.</h2>
<div style="height:10000px;"></div>
<h2>Images with dimensions</h2>
<img width="100" height="60" src="../img/IMG_1578.max-200x200.png"
onload='console.log("onload with dimensions")'>
<br>
<img loading="lazy" width="100" height="60" src="../img/20141021-Google_Edu-Georgetown_U-040_JjRcz9d.max-200x200.jpg"
onload='console.log("onload with dimensions loading=lazy")'>
<br>
<img loading="eager" width="100" height="60" src="../img/w3schools_green.jpg" alt="W3Schools.com"
onload='console.log("onload with dimensions loading=eager")'>
<br>
<h2>Images with no dimensions</h2>
<img src="../img/220px-Sundar_Pichai.jpg"
onload='console.log("onload auto")'>
<br>
<img loading="lazy" src="../img/android-logo-200x200.jpg" loading="eager"
onload='console.log("onload lazy")'>
<br>
<img loading="eager" src="../img/monalisa.jpeg" loading="lazy"
onload='console.log("onload eager")'>
<br>