1.0.2 • Published 5 years ago

is-standalone v1.0.2

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

is-standalone

A tiny function that detects standalone mode for IOS & Android webApp

Installation

npm install is-standalone --save
# or
yarn add is-standalone -D
// for ES module
import isStandalone from 'is-standalone';

// for CMD
const isStandalone = require('is-standalone');

// or
window.isStandalone

How this work?

function isStandalone() {
  return navigator.standalone || (window.matchMedia('(display-mode: standalone)').matches);
}

License

MIT