0.0.2 • Published 7 years ago

@ba0918/simple-custom-url-scheme v0.0.2

Weekly downloads
-
License
MIT
Repository
-
Last release
7 years ago

simple-custom-url-scheme

Build Status

Simple custom URL scheme launcher.

Install

yarn add @ba0918/simple-custom-url-scheme

Usage

for Node.js

import { dispatchFromUserAgent } from '@ba0918/simple-custom-url-scheme'

dispatchFromUserAgent(window.navigator.userAgent, {
  'Android': { url: 'https://www.google.co.jp/', fallback: 'https://www.google.co.jp/' },
  'iOS': { url: 'https://www.google.co.jp/', fallback: 'https://www.google.co.jp/' },
  'PC': { url: 'https://www.google.co.jp/', fallback: 'https://www.google.co.jp/' },
})

for Browser

<script src="./simple-custom-url-scheme.js"></script>
<script>
  window.SimpleCustomURLScheme.dispatchFromUserAgent(window.navigator.userAgent, {
    'Android': { url: 'https://www.google.co.jp/', fallback:   'https://www.google.co.jp/' },
    'iOS': { url: 'https://www.google.co.jp/', fallback: 'https://www.google.co.jp/' },
    'PC': { url: 'https://www.google.co.jp/', fallback: 'https://www.google.co.jp/' },
  });
</script>

Development

Setup

yarn install

Build

yarn run build

Test

yarn run test

Publish

yarn run build
cd dist
npm publish --access=public
0.0.2

7 years ago

0.0.1

7 years ago