proper safari detection in utils
This commit is contained in:
parent
9e8094468b
commit
fba1731cb4
|
@ -24,7 +24,9 @@ export default class BrowserPlatformUtilsService implements PlatformUtilsService
|
||||||
return this.deviceCache;
|
return this.deviceCache;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (navigator.userAgent.indexOf(' Firefox/') !== -1 || navigator.userAgent.indexOf(' Gecko/') !== -1) {
|
if (BrowserApi.isSafariApi) {
|
||||||
|
this.deviceCache = DeviceType.SafariExtension;
|
||||||
|
} else if (navigator.userAgent.indexOf(' Firefox/') !== -1 || navigator.userAgent.indexOf(' Gecko/') !== -1) {
|
||||||
this.deviceCache = DeviceType.FirefoxExtension;
|
this.deviceCache = DeviceType.FirefoxExtension;
|
||||||
} else if ((!!(window as any).opr && !!opr.addons) || !!(window as any).opera ||
|
} else if ((!!(window as any).opr && !!opr.addons) || !!(window as any).opera ||
|
||||||
navigator.userAgent.indexOf(' OPR/') >= 0) {
|
navigator.userAgent.indexOf(' OPR/') >= 0) {
|
||||||
|
@ -33,9 +35,6 @@ export default class BrowserPlatformUtilsService implements PlatformUtilsService
|
||||||
this.deviceCache = DeviceType.EdgeExtension;
|
this.deviceCache = DeviceType.EdgeExtension;
|
||||||
} else if (navigator.userAgent.indexOf(' Vivaldi/') !== -1) {
|
} else if (navigator.userAgent.indexOf(' Vivaldi/') !== -1) {
|
||||||
this.deviceCache = DeviceType.VivaldiExtension;
|
this.deviceCache = DeviceType.VivaldiExtension;
|
||||||
} else if ((window as any).safari && navigator.userAgent.indexOf(' Safari/') !== -1 &&
|
|
||||||
navigator.userAgent.indexOf('Chrome') === -1) {
|
|
||||||
this.deviceCache = DeviceType.SafariExtension;
|
|
||||||
} else if ((window as any).chrome && navigator.userAgent.indexOf(' Chrome/') !== -1) {
|
} else if ((window as any).chrome && navigator.userAgent.indexOf(' Chrome/') !== -1) {
|
||||||
this.deviceCache = DeviceType.ChromeExtension;
|
this.deviceCache = DeviceType.ChromeExtension;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue