mirror of
https://github.com/photonstorm/phaser
synced 2024-11-22 20:53:39 +00:00
Device detection of Apache Cordova
Simple check if "window.cordova" is defined for device detection of Phaser running (most likely) under Apache Cordova.
This commit is contained in:
parent
6da5831f73
commit
d54725212f
1 changed files with 11 additions and 0 deletions
|
@ -37,6 +37,12 @@ Phaser.Device = function (game) {
|
|||
* @default
|
||||
*/
|
||||
this.cocoonJS = false;
|
||||
|
||||
/**
|
||||
* @property {boolean} cordova - Is the game running under Apache Cordova?
|
||||
* @default
|
||||
*/
|
||||
this.cordova = false;
|
||||
|
||||
/**
|
||||
* @property {boolean} ejecta - Is the game running under Ejecta?
|
||||
|
@ -620,6 +626,11 @@ Phaser.Device.prototype = {
|
|||
{
|
||||
this.webApp = true;
|
||||
}
|
||||
|
||||
if (typeof window.cordova !== "undefined")
|
||||
{
|
||||
this.cordova = true;
|
||||
}
|
||||
|
||||
if (navigator['isCocoonJS'])
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue