fix(platform-browser): IEMobile is badly detected when testing (#10382)

This commit is contained in:
Marc Laval
2016-07-29 19:05:12 +02:00
committed by Victor Berchet
parent f0bd528d77
commit 43c71ae103
2 changed files with 18 additions and 3 deletions

View File

@ -28,7 +28,8 @@ export class BrowserDetection {
get isAndroid(): boolean {
return this._ua.indexOf('Mozilla/5.0') > -1 && this._ua.indexOf('Android') > -1 &&
this._ua.indexOf('AppleWebKit') > -1 && this._ua.indexOf('Chrome') == -1;
this._ua.indexOf('AppleWebKit') > -1 && this._ua.indexOf('Chrome') == -1 &&
this._ua.indexOf('IEMobile') == -1;
}
get isEdge(): boolean { return this._ua.indexOf('Edge') > -1; }
@ -36,11 +37,13 @@ export class BrowserDetection {
get isIE(): boolean { return this._ua.indexOf('Trident') > -1; }
get isWebkit(): boolean {
return this._ua.indexOf('AppleWebKit') > -1 && this._ua.indexOf('Edge') == -1;
return this._ua.indexOf('AppleWebKit') > -1 && this._ua.indexOf('Edge') == -1 &&
this._ua.indexOf('IEMobile') == -1;
}
get isIOS7(): boolean {
return this._ua.indexOf('iPhone OS 7') > -1 || this._ua.indexOf('iPad OS 7') > -1;
return (this._ua.indexOf('iPhone OS 7') > -1 || this._ua.indexOf('iPad OS 7') > -1) &&
this._ua.indexOf('IEMobile') == -1;
}
get isSlow(): boolean { return this.isAndroid || this.isIE || this.isIOS7; }