Skip to content

Commit 055cb80

Browse files
committed
Device.crosswalk detects if your game is running under Intels Crosswalk XDK.
1 parent e9cb345 commit 055cb80

2 files changed

Lines changed: 15 additions & 3 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ Version 2.0.4 - "Mos Shirare" - in development
6767

6868
* Loader now has an onFileStart event you can listen for (thanks @codevinsky, #705)
6969
* Timer.clearPendingEvents will purge any events marked for deletion, this is run automatically at the start of the update loop.
70+
* Device.crosswalk detects if your game is running under Intels Crosswalk XDK.
7071

7172

7273
### Bug Fixes

src/system/Device.js

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,17 @@ Phaser.Device = function (game) {
3939
this.cocoonJS = false;
4040

4141
/**
42-
* @property {boolean} ejecta - Is the game running under Ejecta?
43-
* @default
44-
*/
42+
* @property {boolean} ejecta - Is the game running under Ejecta?
43+
* @default
44+
*/
4545
this.ejecta = false;
4646

47+
/**
48+
* @property {boolean} crosswalk - Is the game running under the Intel Crosswalk XDK?
49+
* @default
50+
*/
51+
this.crosswalk = false;
52+
4753
/**
4854
* @property {boolean} android - Is running on android?
4955
* @default
@@ -602,6 +608,11 @@ Phaser.Device.prototype = {
602608
this.ejecta = true;
603609
}
604610

611+
if (/Crosswalk/.test(ua))
612+
{
613+
this.crosswalk = true;
614+
}
615+
605616
},
606617

607618
/**

0 commit comments

Comments
 (0)