|
@@ -129,4 +129,27 @@ export class Utils
|
129
|
129
|
|
130
|
130
|
return false;
|
131
|
131
|
}
|
132
|
|
-}
|
|
132
|
+
|
|
133
|
+ /**
|
|
134
|
+ * Checks if we're on a WebKit-based browser
|
|
135
|
+ * @returns true if we're on a WebKit-based browser
|
|
136
|
+ */
|
|
137
|
+ static isWebKit(): boolean
|
|
138
|
+ {
|
|
139
|
+ // note: navigator.vendor is deprecated.
|
|
140
|
+ // Alternatively, test GL_RENDERER == "Apple GPU"
|
|
141
|
+ if(/Apple/.test(navigator.vendor))
|
|
142
|
+ return true;
|
|
143
|
+
|
|
144
|
+ // Desktop and Mobile Safari, Epiphany on Linux
|
|
145
|
+ if(/AppleWebKit\/.* Version\//.test(navigator.userAgent))
|
|
146
|
+ return true;
|
|
147
|
+
|
|
148
|
+ // Chrome, Firefox, Edge on iOS
|
|
149
|
+ if(/(CriOS\/|FxiOS\/|EdgiOS\/)/.test(navigator.userAgent))
|
|
150
|
+ return true;
|
|
151
|
+
|
|
152
|
+ // not WebKit
|
|
153
|
+ return false;
|
|
154
|
+ }
|
|
155
|
+}
|