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