Skip to content

Commit b5ef896

Browse files
committed
Device.arora has been removed.
Device.epiphany has been removed. Device.midori has been removed. Device.css3D has been removed, and the function that tested it is no longer run. Device.isConsoleOpen has been removed. The function only worked on a very limited set of old browsers. Device.littleEndian has been removed, you can use Device.LITTLE_ENDIAN instead.
1 parent e47a774 commit b5ef896

2 files changed

Lines changed: 11 additions & 115 deletions

File tree

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,12 @@ You can read all about the philosophy behind Lazer [here](http://phaser.io/news/
351351
* PIXI.PI_2 has been removed, because it's available via Phaser.Math.PI2. The only place PI_2 was used has been updated to now use PI2.
352352
* The polyfills.js file now polyfills in for Float32Array, Uint16Array and ArrayBuffer.
353353
* PIXI.Float32Array, PIXI.Uint16Array, PIXI.Uint32Array and PIXI.ArrayBuffer have all been removed, and replaced with their own proper native versions. The polyfill now captures any instances where the browser needs to fall back to an Array instead.
354+
* Device.arora has been removed.
355+
* Device.epiphany has been removed.
356+
* Device.midori has been removed.
357+
* Device.css3D has been removed, and the function that tested it is no longer run.
358+
* Device.isConsoleOpen has been removed. The function only worked on a very limited set of old browsers.
359+
* Device.littleEndian has been removed, you can use Device.LITTLE_ENDIAN instead.
354360

355361

356362
### Bug Fixes

src/utils/Device.js

Lines changed: 5 additions & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -205,12 +205,6 @@ Phaser.Device = function () {
205205
*/
206206
this.worker = false;
207207

208-
/**
209-
* @property {boolean} css3D - Is css3D available?
210-
* @default
211-
*/
212-
this.css3D = false;
213-
214208
/**
215209
* @property {boolean} pointerLock - Is Pointer Lock available?
216210
* @default
@@ -264,12 +258,6 @@ Phaser.Device = function () {
264258

265259
// Browser
266260

267-
/**
268-
* @property {boolean} arora - Set to true if running in Arora.
269-
* @default
270-
*/
271-
this.arora = false;
272-
273261
/**
274262
* @property {boolean} chrome - Set to true if running in Chrome.
275263
* @default
@@ -282,12 +270,6 @@ Phaser.Device = function () {
282270
*/
283271
this.chromeVersion = 0;
284272

285-
/**
286-
* @property {boolean} epiphany - Set to true if running in Epiphany.
287-
* @default
288-
*/
289-
this.epiphany = false;
290-
291273
/**
292274
* @property {boolean} firefox - Set to true if running in Firefox.
293275
* @default
@@ -336,12 +318,6 @@ Phaser.Device = function () {
336318
*/
337319
this.mobileSafari = false;
338320

339-
/**
340-
* @property {boolean} midori - Set to true if running in Midori.
341-
* @default
342-
*/
343-
this.midori = false;
344-
345321
/**
346322
* @property {boolean} opera - Set to true if running in Opera.
347323
* @default
@@ -496,13 +472,7 @@ Phaser.Device = function () {
496472
this.pixelRatio = 0;
497473

498474
/**
499-
* @property {boolean} littleEndian - Is the device big or little endian? (only detected if the browser supports TypedArrays)
500-
* @default
501-
*/
502-
this.littleEndian = false;
503-
504-
/**
505-
* @property {boolean} LITTLE_ENDIAN - Same value as `littleEndian`.
475+
* @property {boolean} LITTLE_ENDIAN - Is the device big or little endian? (only detected if the browser supports TypedArrays)
506476
* @default
507477
*/
508478
this.LITTLE_ENDIAN = false;
@@ -958,11 +928,7 @@ Phaser.Device._initialize = function () {
958928

959929
var ua = navigator.userAgent;
960930

961-
if (/Arora/.test(ua))
962-
{
963-
device.arora = true;
964-
}
965-
else if (/Edge\/\d+/.test(ua))
931+
if (/Edge\/\d+/.test(ua))
966932
{
967933
device.edge = true;
968934
}
@@ -971,10 +937,6 @@ Phaser.Device._initialize = function () {
971937
device.chrome = true;
972938
device.chromeVersion = parseInt(RegExp.$1, 10);
973939
}
974-
else if (/Epiphany/.test(ua))
975-
{
976-
device.epiphany = true;
977-
}
978940
else if (/Firefox\D+(\d+)/.test(ua))
979941
{
980942
device.firefox = true;
@@ -989,10 +951,6 @@ Phaser.Device._initialize = function () {
989951
device.ie = true;
990952
device.ieVersion = parseInt(RegExp.$1, 10);
991953
}
992-
else if (/Midori/.test(ua))
993-
{
994-
device.midori = true;
995-
}
996954
else if (/Opera/.test(ua))
997955
{
998956
device.opera = true;
@@ -1266,11 +1224,10 @@ Phaser.Device._initialize = function () {
12661224

12671225
if (typeof ArrayBuffer !== 'undefined' && typeof Uint8Array !== 'undefined' && typeof Uint32Array !== 'undefined')
12681226
{
1269-
device.littleEndian = _checkIsLittleEndian();
1270-
device.LITTLE_ENDIAN = device.littleEndian;
1227+
device.LITTLE_ENDIAN = _checkIsLittleEndian();
12711228
}
12721229

1273-
device.support32bit = (typeof ArrayBuffer !== 'undefined' && typeof Uint8ClampedArray !== 'undefined' && typeof Int32Array !== 'undefined' && device.littleEndian !== null && _checkIsUint8ClampedImageData());
1230+
device.support32bit = (typeof ArrayBuffer !== 'undefined' && typeof Uint8ClampedArray !== 'undefined' && typeof Int32Array !== 'undefined' && device.LITTLE_ENDIAN !== null && _checkIsUint8ClampedImageData());
12741231

12751232
navigator.vibrate = navigator.vibrate || navigator.webkitVibrate || navigator.mozVibrate || navigator.msVibrate;
12761233

@@ -1281,44 +1238,11 @@ Phaser.Device._initialize = function () {
12811238

12821239
}
12831240

1284-
/**
1285-
* Check whether the host environment support 3D CSS.
1286-
*/
1287-
function _checkCSS3D () {
1288-
1289-
var el = document.createElement('p');
1290-
var has3d;
1291-
var transforms = {
1292-
'webkitTransform': '-webkit-transform',
1293-
'OTransform': '-o-transform',
1294-
'msTransform': '-ms-transform',
1295-
'MozTransform': '-moz-transform',
1296-
'transform': 'transform'
1297-
};
1298-
1299-
// Add it to the body to get the computed style.
1300-
document.body.insertBefore(el, null);
1301-
1302-
for (var t in transforms)
1303-
{
1304-
if (el.style[t] !== undefined)
1305-
{
1306-
el.style[t] = "translate3d(1px,1px,1px)";
1307-
has3d = window.getComputedStyle(el).getPropertyValue(transforms[t]);
1308-
}
1309-
}
1310-
1311-
document.body.removeChild(el);
1312-
device.css3D = (has3d !== undefined && has3d.length > 0 && has3d !== "none");
1313-
1314-
}
1315-
13161241
// Run the checks
13171242
_checkOS();
13181243
_checkBrowser();
13191244
_checkAudio();
13201245
_checkVideo();
1321-
_checkCSS3D();
13221246
_checkDevice();
13231247
_checkFeatures();
13241248
_checkCanvasFeatures();
@@ -1401,41 +1325,6 @@ Phaser.Device.canPlayVideo = function (type) {
14011325

14021326
};
14031327

1404-
/**
1405-
* Check whether the console is open.
1406-
* Note that this only works in Firefox with Firebug and earlier versions of Chrome.
1407-
* It used to work in Chrome, but then they removed the ability: {@link http://src.chromium.org/viewvc/blink?view=revision&revision=151136}
1408-
*
1409-
* @method isConsoleOpen
1410-
* @memberof Phaser.Device.prototype
1411-
*/
1412-
Phaser.Device.isConsoleOpen = function () {
1413-
1414-
if (window.console && window.console['firebug'])
1415-
{
1416-
return true;
1417-
}
1418-
1419-
if (window.console)
1420-
{
1421-
console.profile();
1422-
console.profileEnd();
1423-
1424-
if (console.clear)
1425-
{
1426-
console.clear();
1427-
}
1428-
1429-
if (console['profiles'])
1430-
{
1431-
return console['profiles'].length > 0;
1432-
}
1433-
}
1434-
1435-
return false;
1436-
1437-
};
1438-
14391328
/**
14401329
* Detect if the host is a an Android Stock browser.
14411330
* This is available before the device "ready" event.
@@ -1451,6 +1340,7 @@ Phaser.Device.isConsoleOpen = function () {
14511340
Phaser.Device.isAndroidStockBrowser = function () {
14521341

14531342
var matches = window.navigator.userAgent.match(/Android.*AppleWebKit\/([\d.]+)/);
1343+
14541344
return matches && matches[1] < 537;
14551345

14561346
};

0 commit comments

Comments
 (0)