mirror of
https://github.com/bitwarden/browser.git
synced 2024-10-19 07:35:48 +02:00
14 lines
532 B
TypeScript
14 lines
532 B
TypeScript
|
import { BrowserUtilsService } from './abstractions/browserUtils.service';
|
||
|
import { MessagingService as MessagingServiceInterface } from './abstractions/messaging.service';
|
||
|
|
||
|
export default class BrowserMessagingService implements MessagingServiceInterface {
|
||
|
constructor(private browserUtilsService: BrowserUtilsService) {
|
||
|
}
|
||
|
|
||
|
send(subscriber: string, arg: any = {}) {
|
||
|
// if safari, else
|
||
|
const message = Object.assign({}, { command: subscriber }, arg);
|
||
|
chrome.runtime.sendMessage(message);
|
||
|
}
|
||
|
}
|