Skip to content

Commit c71be2c

Browse files
committed
docs: added further notice on the users browser capabilities
1 parent 69493bc commit c71be2c

1 file changed

Lines changed: 31 additions & 1 deletion

File tree

demo/index.html

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,38 @@ <h1>
9191
</blockquote>
9292

9393
<p class="scrolling-advice">
94-
The following whitespace is included as a threshold, <strong>please scroll down to the very end of this demo page</strong> to see these images being loaded by the polyfill on
94+
The following whitespace is included as a threshold,
95+
<strong>please scroll down to the very end of this demo page</strong> to
96+
see these images and iframe content being loaded by the polyfill on
9597
<a href="https://caniuse.com/loading-lazy-attr">unsupported browsers</a>
98+
(hint:
99+
<strong
100+
>Your browser
101+
<script type="text/javascript">
102+
if (
103+
"loading" in HTMLImageElement.prototype ||
104+
"loading" in HTMLIFrameElement.prototype
105+
) {
106+
document.write(
107+
"supports the following native loading lazy capabilities:"
108+
);
109+
110+
if ("loading" in HTMLImageElement.prototype) {
111+
document.write("images");
112+
113+
if ("loading" in HTMLIFrameElement.prototype) {
114+
document.write(", iframes");
115+
}
116+
} else if ("loading" in HTMLIFrameElement.prototype) {
117+
document.write("iframes");
118+
}
119+
} else {
120+
document.write(
121+
"doesn't support the native loading lazy capabilities"
122+
);
123+
}
124+
</script></strong
125+
>)
96126
<span aria-hidden="true"></span>
97127
</p>
98128
</header>

0 commit comments

Comments
 (0)