You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
### Additional information on your image and document (iframe) references
@@ -87,13 +93,13 @@ And please "Avoid lazy-loading images that are in the first visible viewport", c
87
93
88
94
### Register a Service Worker
89
95
90
-
Furthermore you would either need to integrate the code out of [loading-attribute-polyfill.sw.js](loading-attribute-polyfill.sw.js) to your existing [Service Worker](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorker) or register one by yourself – please keep in mind that it's very important to add the feature detection to the Service Workers URL within the `navigator.serviceWorker.register` methods parameter, as we're transfering that information on the users enviroments capabilities via this way.
96
+
Furthermore you would either need to integrate the code out of [loading-attribute-polyfill-with-serviceworker.sw.js](loading-attribute-polyfill-with-serviceworker.sw.js) to your existing [Service Worker](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorker) or register one by yourself – please keep in mind that it's very important to add the feature detection to the Service Workers URL within the `navigator.serviceWorker.register` methods parameter, as we're transfering that information on the users enviroments capabilities via this way.
91
97
92
98
```javascript
93
99
if ("serviceWorker"innavigator) {
94
100
// Differentiate in between the Service Worker scripts for the different browser capabilities / support
@@ -174,7 +180,7 @@ if ("serviceWorker" in navigator) {
174
180
In case that you're dynamically adding HTML elements within the browser, you could call the following method with an included [HTMLElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement) object, like e.g.:
compare to the code within [demo/loading-attribute-polyfill.custom-builtin-extend.image.js](demo/loading-attribute-polyfill.custom-builtin-extend.image.js) (or [demo/loading-attribute-polyfill.custom-builtin-extend.iframe.js](demo/loading-attribute-polyfill.custom-builtin-extend.iframe.js) for iframe elements).
217
+
compare to the code within [demo/loading-attribute-polyfill-with-serviceworker.custom-builtin-extend.image.js](demo/loading-attribute-polyfill-with-serviceworker.custom-builtin-extend.image.js) (or [demo/loading-attribute-polyfill-with-serviceworker.custom-builtin-extend.iframe.js](demo/loading-attribute-polyfill-with-serviceworker.custom-builtin-extend.iframe.js) for iframe elements).
212
218
213
219
In case that you even also would like to support Safari / WebKit browsers, you'll need a polyfill as this engine doesn't support that part of the Custom Elements standard so far: <https://www.npmjs.com/package/@ungap/custom-elements>
0 commit comments