|
|
|
@ -18,12 +18,19 @@ export default class ContentMessageListener { |
|
|
|
|
|
|
|
|
|
run() { |
|
|
|
|
browser.runtime.onMessage.addListener((message, sender) => { |
|
|
|
|
return this.onMessage(message, sender).catch((e) => { |
|
|
|
|
try { |
|
|
|
|
return this.onMessage(message, sender).catch((e) => { |
|
|
|
|
return browser.tabs.sendMessage(sender.tab.id, { |
|
|
|
|
type: messages.CONSOLE_SHOW_ERROR, |
|
|
|
|
text: e.message, |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
} catch (e) { |
|
|
|
|
return browser.tabs.sendMessage(sender.tab.id, { |
|
|
|
|
type: messages.CONSOLE_SHOW_ERROR, |
|
|
|
|
text: e.message, |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|