11import { Injectable } from '@angular/core' ;
22
3- declare const window : any ;
4-
53// Whether the current platform supports the V8 Break Iterator. The V8 check
64// is necessary to detect all Blink based browsers.
7- const hasV8BreakIterator = typeof ( window ) !== 'undefined' ?
8- ( window . Intl && ( window . Intl as any ) . v8BreakIterator ) :
9- ( typeof ( Intl ) !== 'undefined' && ( Intl as any ) . v8BreakIterator ) ;
5+ const hasV8BreakIterator = ( typeof ( Intl ) !== 'undefined' && ( Intl as any ) . v8BreakIterator ) ;
106
117/**
128 * Service to detect the current platform by comparing the userAgent strings and
@@ -22,14 +18,14 @@ export class Platform {
2218 TRIDENT = / ( m s i e | t r i d e n t ) / i. test ( navigator . userAgent ) ;
2319
2420 // EdgeHTML and Trident mock Blink specific things and need to be excluded from this check.
25- BLINK = ! ! ( window . chrome || hasV8BreakIterator ) && ! ! CSS && ! this . EDGE && ! this . TRIDENT ;
21+ BLINK = ! ! ( ( window as any ) . chrome || hasV8BreakIterator ) && ! ! CSS && ! this . EDGE && ! this . TRIDENT ;
2622
2723 // Webkit is part of the userAgent in EdgeHTML, Blink and Trident. Therefore we need to
2824 // ensure that Webkit runs standalone and is not used as another engine's base.
2925 WEBKIT = / A p p l e W e b K i t / i. test ( navigator . userAgent ) && ! this . BLINK && ! this . EDGE && ! this . TRIDENT ;
3026
3127 /** Browsers and Platform Types */
32- IOS = / i P a d | i P h o n e | i P o d / . test ( navigator . userAgent ) && ! window . MSStream ;
28+ IOS = / i P a d | i P h o n e | i P o d / . test ( navigator . userAgent ) && ! ( window as any ) . MSStream ;
3329
3430 // It's difficult to detect the plain Gecko engine, because most of the browsers identify
3531 // them self as Gecko-like browsers and modify the userAgent's according to that.
0 commit comments