Skip to content

Commit

Permalink
fix(MessageCenter): async listener
Browse files Browse the repository at this point in the history
  • Loading branch information
Jack-Works committed Sep 4, 2019
1 parent dded411 commit 62d6113
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Extension/MessageCenter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ export class MessageCenter<ITypedMessages> {
if (typeof browser !== 'undefined' && browser.runtime && browser.runtime.onMessage) {
// Fired when a message is sent from either an extension process (by runtime.sendMessage)
// or a content script (by tabs.sendMessage).
browser.runtime.onMessage.addListener(this.listener)
browser.runtime.onMessage.addListener((e: InternalMessageType) => {
this.listener(e)
})
}
if (typeof document !== 'undefined' && document.addEventListener) {
document.addEventListener(MessageCenterEvent, this.listener)
Expand Down

0 comments on commit 62d6113

Please sign in to comment.