mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-10 09:59:48 +01:00
compile fixes
This commit is contained in:
parent
58a73bcb0f
commit
384f3f1e47
@ -1,3 +1,5 @@
|
||||
import { SafariApp } from './safariApp';
|
||||
|
||||
export class BrowserApi {
|
||||
static isWebExtensionsApi: boolean = (typeof browser !== 'undefined');
|
||||
static isSafariApi: boolean = (window as any).safariAppExtension === true;
|
||||
@ -222,7 +224,7 @@ export class BrowserApi {
|
||||
} else if (BrowserApi.isWebExtensionsApi || BrowserApi.isChromeApi) {
|
||||
win.close();
|
||||
} else if (BrowserApi.isSafariApi && safari.extension.popovers && safari.extension.popovers.length > 0) {
|
||||
BrowserApi.sendSafariMessageToApp({ command: 'hideWindow' });
|
||||
SafariApp.sendMessageToApp('hideWindow');
|
||||
}
|
||||
}
|
||||
|
||||
@ -286,7 +288,7 @@ export class BrowserApi {
|
||||
if (win != null) {
|
||||
return win.location.reload(true);
|
||||
} else if (BrowserApi.isSafariApi) {
|
||||
BrowserApi.sendSafariMessageToApp({ command: 'reloadWindow' });
|
||||
SafariApp.sendMessageToApp('reloadWindow');
|
||||
} else if (!BrowserApi.isSafariApi) {
|
||||
return chrome.runtime.reload();
|
||||
}
|
||||
|
@ -1,14 +1,14 @@
|
||||
import { BrowserApi } from '../browser/browserApi';
|
||||
import { SafariApp } from '../browser/safariApp';
|
||||
|
||||
import { MessagingService } from 'jslib/abstractions';
|
||||
import { MessagingService } from 'jslib/abstractions/messaging.service';
|
||||
|
||||
export default class BrowserMessagingService implements MessagingService {
|
||||
send(subscriber: string, arg: any = {}) {
|
||||
const message = Object.assign({}, { command: subscriber }, arg);
|
||||
|
||||
if (BrowserApi.isSafariApi) {
|
||||
BrowserApi.sendSafariMessageToApp(message);
|
||||
SafariApp.sendMessageToApp(subscriber, arg);
|
||||
} else {
|
||||
const message = Object.assign({}, { command: subscriber }, arg);
|
||||
chrome.runtime.sendMessage(message);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user