bitwarden-estensione-browser/src/services/browserMessaging.service.ts

13 lines
427 B
TypeScript
Raw Normal View History

import { Abstractions } from '@bitwarden/jslib';
2018-01-04 22:06:00 +01:00
export default class BrowserMessagingService implements Abstractions.MessagingService {
constructor(private platformUtilsService: Abstractions.PlatformUtilsService) {
2018-01-04 22:06:00 +01:00
}
send(subscriber: string, arg: any = {}) {
// if safari, else
const message = Object.assign({}, { command: subscriber }, arg);
chrome.runtime.sendMessage(message);
}
}