Skip to content

Commit 515b927

Browse files
committed
docs: restructured README
1 parent d2ac2e3 commit 515b927

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

README.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
11
# loading="lazy" attribute polyfill with Service Worker
22

3-
Fast and lightweight dependency-free vanilla JavaScript polyfill for native lazy loading / the awesome loading='lazy'-attribute, depending on Service Worker (kudos for that [great idea](https://github.com/mfranzke/loading-attribute-polyfill/issues/88#issuecomment-649723103) to [@garygreen](https://github.com/garygreen) !!!)
4-
53
[![MIT license](https://img.shields.io/npm/l/loading-attribute-polyfill-with-serviceworker.svg "license badge")](https://opensource.org/licenses/mit-license.php)
4+
[![npm bundle size](https://img.shields.io/bundlephobia/minzip/loading-attribute-polyfill-with-serviceworker)](https://bundlephobia.com/result?p=loading-attribute-polyfill-with-serviceworker)
5+
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/4f4cc692565d425c82860d18a11f17d4)](https://www.codacy.com/gh/mfranzke/loading-attribute-polyfill-with-serviceworker/dashboard)
6+
[![Known Vulnerabilities](https://snyk.io/test/github/mfranzke/loading-attribute-polyfill-with-serviceworker/badge.svg?targetFile=package.json)](https://snyk.io/test/github/mfranzke/loading-attribute-polyfill-with-serviceworker?targetFile=package.json)
7+
[![CodeQL](https://github.com/mfranzke/loading-attribute-polyfill-with-serviceworker/actions/workflows/codeql-analysis.yml/badge.svg?branch=main)](https://github.com/mfranzke/loading-attribute-polyfill-with-serviceworker/actions/workflows/codeql-analysis.yml)
68
[![GitHub Super-Linter](https://github.com/mfranzke/loading-attribute-polyfill-with-serviceworker/workflows/Lint%20Code%20Base/badge.svg)](https://github.com/mfranzke/loading-attribute-polyfill-with-serviceworker/actions/workflows/linter.yml)
79
[![dependencies Status](https://david-dm.org/mfranzke/loading-attribute-polyfill-with-serviceworker/status.svg "Count of dependencies")](https://david-dm.org/mfranzke/loading-attribute-polyfill-with-serviceworker "loading-attribute polyfill – on david-dm")
10+
[![loading-attribute-polyfill on Npmjs](https://img.shields.io/npm/v/loading-attribute-polyfill-with-serviceworker.svg?color=rgb%28237%2C%2028%2C%2036%29 "npm version")](https://npmjs.com/package/loading-attribute-polyfill-with-serviceworker 'loading="lazy"-attribute polyfill – on NPM')
811
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
912
[![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/xojs/xo)
1013
[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org)
14+
[![Join the chat at https://gitter.im/loading-attribute-polyfill-with-serviceworker/community](https://badges.gitter.im/loading-attribute-polyfill-with-serviceworker/community.svg)](https://gitter.im/loading-attribute-polyfill-with-serviceworker/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
1115
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)
1216
[![Open Source Love](https://badges.frapsoft.com/os/v3/open-source.svg?v=103)](https://github.com/ellerbrock/open-source-badges/)
1317
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.0-4baaaa.svg)](CODE-OF-CONDUCT.md)
1418

19+
Fast and lightweight dependency-free vanilla JavaScript polyfill for native lazy loading / the awesome loading='lazy'-attribute, depending on Service Worker (kudos for that [great idea](https://github.com/mfranzke/loading-attribute-polyfill/issues/88#issuecomment-649723103) to [@garygreen](https://github.com/garygreen) !!!)
20+
1521
- Released under the MIT license
1622
- Made in Germany. And supported by so many great people from all over this planet - see "Credits" accordingly.
1723
- Compatible [down to Microsoft Internet Explorer 17](https://caniuse.com/?search=serviceworker)
@@ -22,6 +28,9 @@ Fast and lightweight dependency-free vanilla JavaScript polyfill for native lazy
2228
- Web standards: supports the standard `loading="lazy"` attribute on `img` and `iframe` elements
2329
- Performance: it's based on highly efficient, best practice code.
2430
- SEO & crawlers: the image and iframe contents aren't being hidden from crawlers that aren't capable of scrolling.
31+
- JavaScript framework friendly\*
32+
33+
\*As some JavaScript frameworks would like to "own the DOM", it's not a good practice to try to manipulate the HTML content by our polyfill. That for this solution hooks into the network connection (by a Service Worker that you would need to register) to intercept the image and iframe contents requests.
2534

2635
## Core concepts
2736

@@ -51,7 +60,7 @@ Include one of the provided JavaScript files depending on your setup plus the CS
5160
or e.g. within JS
5261

5362
```js
54-
import loadingAttributePolyfill from "node_modules/loading-attribute-polyfill-with-serviceworker/dist/loading-attribute-polyfill-with-serviceworker.module.js";
63+
import loadingAttributePolyfill from "node_modules/loading-attribute-polyfill-with-serviceworker/dist/loading-attribute-polyfill.module.js";
5564
```
5665

5766
### Additional information on your image and document (iframe) references

0 commit comments

Comments
 (0)