|
@@ -81,7 +81,12 @@
|
|
|
addListener: listener => chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
|
|
addListener: listener => chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
|
|
|
const response = listener(message, sender);
|
|
const response = listener(message, sender);
|
|
|
if (response && typeof response.then == "function") {
|
|
if (response && typeof response.then == "function") {
|
|
|
- response.then(sendResponse);
|
|
|
|
|
|
|
+ response.then(response => {
|
|
|
|
|
+ sendResponse(response);
|
|
|
|
|
+ if (chrome.runtime.lastError) {
|
|
|
|
|
+ console.error(chrome.runtime.lastError); // eslint-disable-line no-console
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|
|
|
}),
|
|
}),
|