is-standalone
v1.0.2
Published
function isRunningStandalone() {
Downloads
41
Maintainers
Readme
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