1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-16 16:23:44 +00:00

abstract MessagingService

This commit is contained in:
Kyle Spearrin
2018-01-04 16:06:00 -05:00
parent 0fbbc4a0b9
commit d39c5b37dc
10 changed files with 51 additions and 23 deletions

View File

@@ -0,0 +1,13 @@
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);
}
}