# nav_share_polyfill

> navigator.share() polyfill - A polyfill for navigator.share

Latest version **1.0.0** (published 2020-08-24) · ISC license · 0 weekly downloads

## Install

```sh
npm install nav_share_polyfill
pnpm add nav_share_polyfill
yarn add nav_share_polyfill
bun add nav_share_polyfill
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2020-08-24 |
| First published | 2020-08-24 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 18.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Isaque Schluter |
| Maintainers | isaqueks |
| Keywords | navigator.share, polyfill, sharing, javascript |

## Links

- npm: https://www.npmjs.com/package/nav_share_polyfill
- Repository: https://github.com/isaqueks/nav_share_polyfill
- Homepage: https://github.com/isaqueks/nav_share_polyfill#readme
- Issues: https://github.com/isaqueks/nav_share_polyfill/issues
- npm.io page: https://npm.io/package/nav_share_polyfill

## Recent versions

- 1.0.0 (latest) — 2020-08-24

## README

# A polyfill for navigator.share()
Demo: [test here](https://isaqueks.github.io/nav_share_polyfill/)
<br>
<img src="https://github.com/isaqueks/nav_share_polyfill/raw/master/navigator.share()%20polyfill.gif" height="400"></img>
<br>
<hr>
A good navigator.share polyfill. Looks like native. It's size is about 4kb. Eazy to use, free and open-source.
<hr>
Usage:

    var data  =  {
	    title:  'navigator.share() polyfill',
	    text:  'A polyfill for navigator.share()',
	    url:  location.href,
	}
	navigator.share(data)
	.then(function()  {
		alert('You shared it!')
	})
	.catch(function(e)  {
		alert('Error');
	});

Don't forgget to include the script:

    https://isaqueks.github.io/nav_share_polyfill/navigator.share.js

OR (minified)

    https://isaqueks.github.io/nav_share_polyfill/navigator.share.min.js

If you want to force the polyfill (even if the browser supports navigator.share()), insert this code (before the main script):

    window.FORCE_SHARE_POLYFILL = true;

Works for mobile and desktop (most desktop browsers doesn't support native navigator.share())

---
_Source: https://npm.io/package/nav_share_polyfill · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
