Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eusonlito/jquery.applink
Launch native apps from web page links for mobile and desktop devices
https://github.com/eusonlito/jquery.applink
applink javascript jquery native-apps
Last synced: 17 days ago
JSON representation
Launch native apps from web page links for mobile and desktop devices
- Host: GitHub
- URL: https://github.com/eusonlito/jquery.applink
- Owner: eusonlito
- License: apache-2.0
- Created: 2013-09-06T21:01:35.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2016-04-08T08:41:36.000Z (over 8 years ago)
- Last Synced: 2024-10-18T04:23:54.456Z (26 days ago)
- Topics: applink, javascript, jquery, native-apps
- Language: JavaScript
- Homepage:
- Size: 37.1 KB
- Stars: 135
- Watchers: 14
- Forks: 31
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
jquery.applink
==============Create links to native apps from mobile (or minor cases from desktop) browsers.
HTML links should have the web url as default, but you can add an alternate link using the registered app protocol to invoke apps like Facebook, Twitter, Foursquare, etc...
Example:
```html
My Facebook Profile
```Also, you can use it to share your page, like:
```html
Share My Web in Twitter
```This action will try to open the Twitter mobile app, and if is not available, it will open the default share modal at browser.
You have a extended schemes list available at http://wiki.akosma.com/IPhone_URL_Schemes and http://handleopenurl.com/scheme
Plugin detects the `target="_blank"` tag attribute, but take care because the window will be open with javascript function `window.open` and can be blocked by browser.
To enable the plugin:
```javascript
$(document).ready(function () {
$('a[data-applink]').applink();
});
```All options and default values:
```javascript
$(document).ready(function () {
$('a[data-applink]').applink({
popup: 'auto', // disable/enable share popup created by plugin. If auto, only will be enabled to popupDomains domains
popupDomains: 'twitter|facebook', // If "popup" option is auto, it will check this domains to open a domain or redirect to page
desktop: false, // disable/enable native app check for no mobile devices
data: 'applink' // load native links from data-XXXXXX attribute,
timeout: 1500 // time in ms to detect app before launch HTTP link (only when is mobile and desktop is false)
});
});
```Also, if you are using this plugin to set native links to a large list, you can use the delegate function to get the best performance:
```javascript
$(document).ready(function () {
$('.links-list').applink({
popup: 'auto', // disable/enable share popup created by plugin. If auto, only will be enabled to popupDomains domains
popupDomains: 'twitter|facebook', // If "popup" option is auto, it will check this domains to open a domain or redirect to page
desktop: false, // disable/enable native app check for no mobile devices
delegate: 'a[data-applink]', // Delegate action into the parent element (default is null)
data: 'applink' // load native links from data-XXXXXX attribute,
timeout: 1500 // time in ms to detect app before launch HTTP link (only when is mobile and desktop is false)
});
});
```Enjoy!