1.0.4 • Published 7 years ago

web-share-shim v1.0.4

Weekly downloads
8
License
ISC
Repository
-
Last release
7 years ago

Web Share Shim

A polyfill for the WebShare API. It provides navigator.share() so you can share content on any device via WhatsApp, Telegram, Facebook, e-mail, and SMS. Try the demo! The whole package is 9.6kB minified, 4kB gzipped and licensed under the MIT License.

Usage

Open the share dialog by calling navigator.share:

  navigator.share({
    title: 'Web Share Shim',
    text: 'Check out Web Share Shim — it rocks!',
    url: 'http://nimiq.github.io/web-share-shim',
  })
  .then( _ => console.log('Successful share'))
  .catch( error => console.log('Error sharing', error));
AttributeOptionsDefaultDescription
titleString""A short title of what you are sharing.
textString""A text describing what you are sharing.
urlURL as String""A link to what you are sharing.
facebookIdnumber"158651941570418"ID of your facebook app if you want to support sharing to facebook on a desktop device. (default ID for demo only)

Build source code

You need to have gulp and all dependencies installed.

npm install 
npm install gulp

Then run gulp to build web-share-shim.bundle.min.js.

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago