Skip to content

Commit d2366d5

Browse files
committed
Fix for issue phaserjs#376 - IE11 didn't populate the Device.ieVersion value. Now extracted from Trident revision, but still use Device.trident instead for IE11+ checks.
1 parent ae74cb0 commit d2366d5

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ Bug Fixes:
113113
* Fixed bug where changing State would cause the camera to not reset if it was following an object.
114114
* Tile had 2 properties (callback and callbackContext) that were never assigned, updated to use the proper names (thanks ratkingsimon)
115115
* Issue 382: Error when using InputHandler#onInputUp & sprite destroys itself during the event.
116+
* IE11 didn't populate the Device.ieVersion value. Now extracted from Trident revision, but still use Device.trident instead for IE11+ checks.
116117

117118

118119
You can view the Change Log for all previous versions at https://github.com/photonstorm/phaser/changelog.md

src/system/Device.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ Phaser.Device = function () {
189189
this.ie = false;
190190

191191
/**
192-
* @property {number} ieVersion - If running in Internet Explorer this will contain the major version number.
192+
* @property {number} ieVersion - If running in Internet Explorer this will contain the major version number. Beyond IE10 you should use Device.trident and Device.tridentVersion.
193193
* @default
194194
*/
195195
this.ieVersion = 0;
@@ -474,11 +474,12 @@ Phaser.Device.prototype = {
474474
{
475475
this.silk = true;
476476
}
477-
else if (/Trident\/(\d+\.\d+);/.test(ua))
477+
else if (/Trident\/(\d+\.\d+); rv:(\d+\.\d+)/.test(ua))
478478
{
479479
this.ie = true;
480480
this.trident = true;
481481
this.tridentVersion = parseInt(RegExp.$1, 10);
482+
this.ieVersion = parseInt(RegExp.$2, 10);
482483
}
483484

484485
// WebApp mode in iOS

0 commit comments

Comments
 (0)