Socket
Socket
Sign inDemoInstall

web-share-shim

Package Overview
Dependencies
0
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    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](http://nimiq.github.io/web-share-shim/demo/)! The whole package is 9.6kB minified, 4k


Version published
Weekly downloads
8
increased by33.33%
Maintainers
1
Install size
32.0 kB
Created
Weekly downloads
 

Readme

Source

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.

FAQs

Last updated on 22 Aug 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc