is-standalone
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

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

Package Sidebar

Install

npm i is-standalone

Weekly Downloads

13

Version

1.0.2

License

MIT

Unpacked Size

2.71 kB

Total Files

5

Last publish

Collaborators

  • geoffzhu