mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-07 09:31:31 +01:00
fix safari browser test
This commit is contained in:
parent
8009a37717
commit
a7dabc45f1
@ -79,6 +79,11 @@ describe('Browser Utils Service', () => {
|
|||||||
|
|
||||||
const browserPlatformUtilsService = new BrowserPlatformUtilsService(null, null);
|
const browserPlatformUtilsService = new BrowserPlatformUtilsService(null, null);
|
||||||
expect(browserPlatformUtilsService.getDevice()).toBe(DeviceType.SafariExtension);
|
expect(browserPlatformUtilsService.getDevice()).toBe(DeviceType.SafariExtension);
|
||||||
|
|
||||||
|
Object.defineProperty(window, 'safariAppExtension', {
|
||||||
|
configurable: true,
|
||||||
|
value: false,
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should detect vivaldi', () => {
|
it('should detect vivaldi', () => {
|
||||||
|
@ -24,7 +24,7 @@ export default class BrowserPlatformUtilsService implements PlatformUtilsService
|
|||||||
return this.deviceCache;
|
return this.deviceCache;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (BrowserApi.isSafariApi) {
|
if ((window as any).safariAppExtension === true) {
|
||||||
this.deviceCache = DeviceType.SafariExtension;
|
this.deviceCache = DeviceType.SafariExtension;
|
||||||
} else if (navigator.userAgent.indexOf(' Firefox/') !== -1 || navigator.userAgent.indexOf(' Gecko/') !== -1) {
|
} else if (navigator.userAgent.indexOf(' Firefox/') !== -1 || navigator.userAgent.indexOf(' Gecko/') !== -1) {
|
||||||
this.deviceCache = DeviceType.FirefoxExtension;
|
this.deviceCache = DeviceType.FirefoxExtension;
|
||||||
|
Loading…
Reference in New Issue
Block a user