From 2c13de9c7b4a63d7b6ff63962fafd9e00b7ad75b Mon Sep 17 00:00:00 2001 From: Max Lynch Date: Fri, 4 Dec 2015 11:02:49 -0600 Subject: [PATCH] fix(platform): pass regexp to testNavigatorPlatform --- ionic/platform/platform.ts | 3 +-- ionic/platform/registry.ts | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/ionic/platform/platform.ts b/ionic/platform/platform.ts index cba958b23e..90d050833b 100644 --- a/ionic/platform/platform.ts +++ b/ionic/platform/platform.ts @@ -301,8 +301,7 @@ export class Platform { * @returns {boolean} TODO */ testNavigatorPlatform(navigatorPlatformExpression) { - let rgx = new RegExp(navigatorPlatformExpression, 'i'); - return rgx.test(this._bPlt || ''); + return navigatorPlatformExpression.test(this._bPlt || ''); } /** diff --git a/ionic/platform/registry.ts b/ionic/platform/registry.ts index f9481695b8..57233170df 100644 --- a/ionic/platform/registry.ts +++ b/ionic/platform/registry.ts @@ -52,7 +52,7 @@ Platform.register({ // however, under-powered devices shouldn't use ripple // if this a linux device, and is using Android Chrome v36 (Android 5.0) // or above then use ripple, otherwise do not use a ripple effect - if (p.testNavigatorPlatform('linux')) { + if (p.testNavigatorPlatform('/linux/i')) { let chromeVersion = p.matchUserAgentVersion(/Chrome\/(\d+).(\d+)?/); if (chromeVersion) { // linux android device using modern android chrome browser gets ripple @@ -175,5 +175,5 @@ function isIOSDevice(p) { // checks navigator.platform to see if it's an actual iOS device // this does not use the user-agent string because it is often spoofed // an actual iPad will return true, a chrome dev tools iPad will return false - return p.testNavigatorPlatform(/iphone|ipad|ipod/); + return p.testNavigatorPlatform(/iphone|ipad|ipod/i); }