We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 31f450d + 4183237 commit ee579c2Copy full SHA for ee579c2
1 file changed
src/system/Device.js
@@ -900,3 +900,16 @@ Phaser.Device.prototype = {
900
};
901
902
Phaser.Device.prototype.constructor = Phaser.Device;
903
+
904
+/**
905
+* A class-static function to check wether we’re running on an Android Stock browser.
906
+* Autors might want to scale down on effects and switch to the CANVAS rendering method on those devices.
907
+* Usage: var defaultRenderingMode = Phaser.Device.isAndroidStockBrowser() ? Phaser.CANVAS : Phaser.AUTO;
908
+*
909
+* @function Phaser.Device#isAndroidStockBrowser
910
+*/
911
+Phaser.Device.isAndroidStockBrowser = function()
912
+{
913
+ var matches = window.navigator.userAgent.match(/Android.*AppleWebKit\/([\d.]+)/);
914
+ return matches && matches[1] < 537;
915
+};
0 commit comments