mirror of
https://github.com/photonstorm/phaser
synced 2024-11-10 23:24:41 +00:00
Tests for both Node and Node-Webkit
This commit is contained in:
parent
2065c3a77a
commit
a0840274f7
1 changed files with 16 additions and 1 deletions
|
@ -44,6 +44,12 @@ Phaser.Device = function (game) {
|
|||
*/
|
||||
this.cordova = false;
|
||||
|
||||
/**
|
||||
* @property {boolean} node - Is the game running under Node.js?
|
||||
* @default
|
||||
*/
|
||||
this.node = false;
|
||||
|
||||
/**
|
||||
* @property {boolean} nodeWebkit - Is the game running under Node-Webkit?
|
||||
* @default
|
||||
|
@ -640,7 +646,16 @@ Phaser.Device.prototype = {
|
|||
|
||||
if(typeof process !== "undefined" && typeof require !== "undefined")
|
||||
{
|
||||
this.nodeWebkit = true;
|
||||
this.node = true;
|
||||
}
|
||||
|
||||
if(this.node)
|
||||
{
|
||||
try {
|
||||
this.nodeWebkit = (typeof require('nw.gui') !== "undefined");
|
||||
} catch(error) {
|
||||
this.nodeWebkit = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (navigator['isCocoonJS'])
|
||||
|
|
Loading…
Reference in a new issue