Skip to content
This repository was archived by the owner on Jul 3, 2024. It is now read-only.

Sets a global variable (window.isInstalled) to let you know if the web page has been installed as a standalone app.

License

Notifications You must be signed in to change notification settings

easy-designs/isInstalled.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

isInstalled.js

This script runs a series of tests to determine if the page running it is being run in "standalone" or "installed app" mode and then exposes a single global variable, window.isInstalled with a boolean value indicating the page’s status.

This makes it inconsequential to do things like this:

if ( window.isInstalled )
{
	// observes clicks on links (using jQuery) and 
	// ensures they don’t revert to open in the 
	// default browser
	$body.on( 'click', 'a', function(e){
		e.preventDefault();
		window.location = this.getAttribute( 'href' );
        return false;
	});
}

Framework Dependencies

None.

About

Sets a global variable (window.isInstalled) to let you know if the web page has been installed as a standalone app.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published