Socket
Socket
Sign inDemoInstall

micro-app

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

micro-app

[iOS] Integrated Safari features about web app.


Version published
Weekly downloads
17
increased by30.77%
Maintainers
1
Weekly downloads
 
Created
Source

micro-app

Integrated Safari features about web app.

Getting started

$ npm install micro-app
$ npm run demo

How to use

1. Declare feature on the script tag which has an attribute "micro-app".
<script micro-app src="micro-app.min.js" capable></script>
2. Select the script tag which has an attribute "micro-app" then set feature by "setAttribute".
<script micro-app src="micro-app.min.js"></script>
<script>
    document.querySelector('script[micro-app]').setAttribute('capable', true);
</script>
3. Assign feature on the global namespace "microApp".
<script src="micro-app.min.js"></script>
<script>
    microApp.capable = true;
</script>

Features

  • $ : Replace your value.
  • null : Null can remove the feature.
capable

<meta name="apple-mobile-web-app-capable" content="yes">

status-bar-style

<meta name="apple-mobile-web-app-status-bar-style" content="$">

  • Both microApp["status-bar-style"] and microApp.statusBarStyle are same.
title

<meta name="apple-mobile-web-app-title" content="$">

icon

<link rel="apple-touch-icon" href="$">

splash

<link rel="apple-touch-startup-image" href="$">

href
  • Save your link in location.hash.

Multiple

Use Array and Object to set multiple icon and splash. @see /demo/jquery/entry/index.js

Methods

filter(...)
  • Define a filter that filter the url about icon and splash.
ArgumentDescription
Stringfilter name
Functionfilter handler
Return values
microApp
hash(...)
  • Get a value by key from location.hash.
ArgumentDescription
Stringkey
Return values
value
  • Set a value by key from location.hash.
ArgumentDescription
Stringkey
Stringvalue
Return values
microApp

Filters

#precomposed
  • Set the attribute rel="apple-touch-icon-precomposed".
#autosize
  • Set sizes or media after computed.

License

MIT

Keywords

FAQs

Package last updated on 22 Aug 2016

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc