Skip to content

Commit

Permalink
Merge pull request #1150 from videlais/patch-3
Browse files Browse the repository at this point in the history
Detect CocoonJS.App
  • Loading branch information
photonstorm committed Aug 30, 2014
2 parents daf7902 + 3f7f6fa commit 5cfb51b
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/system/Device.js
Expand Up @@ -38,6 +38,12 @@ Phaser.Device = function (game) {
*/
this.cocoonJS = false;

/**
* @property {boolean} cocoonJSApp - Is this game running with CocoonJS.App?
* @default
*/
this.cocoonJSApp = false;

/**
* @property {boolean} cordova - Is the game running under Apache Cordova?
* @default
Expand Down Expand Up @@ -662,6 +668,15 @@ Phaser.Device.prototype = {
{
this.cocoonJS = true;
}

if(this.cocoonJS)
{
try {
this.cocoonJSApp = (typeof CocoonJS !== "undefined");
} catch(error) {
this.cocoonJSApp = false;
}
}

if (typeof window.ejecta !== "undefined")
{
Expand Down

0 comments on commit 5cfb51b

Please sign in to comment.