This two-day promotion, the need to achieve the page to share the major foreign social media functions. To go through the documents of the major manufacturers, the implementation of time is quite long.
A plugin was found on GitHub, which is 6. Address: Https://github.com/ellisonleao/sharer.js
Support the sharing of mainstream foreign social media.
Main support:
- Twitter
- Facebook
- Linkedin
- Google Plus
- Email
- Whatsapp
- Telegram
- Viber
- Pinterest
- Tumblr
- Hackernews
- Reddit
- VK.com
- Buffer
- Xing
- Line
- Instapaper
- Pocket
- Digg
- StumbleUpon
- Flipboard
- Weibo
- Renren
- Myspace
- Blogger
- Baidu
- ok.ru
If the corresponding app is installed, the app is automatically opened for sharing, and if it's not installed, the browser opens the corresponding site share.
In addition, there are only a few apps available in the app version, such as WhatApp, line, Viber test on the PC, invalid click. For this situation, it is necessary to detect whether the current browser environment is a PC or mobile, to control the display and hiding of the page share button.
Social media for the domestic: https://github.com/overtrue/share.js
Web Share plugin Share.js used abroad