summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-04-07 19:49:54 -0400
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-04-07 19:49:54 -0400
commit96566b8581549adba7cd24f37537fd7910eb8d37 (patch)
tree3b3ecf7751eb93725edeb6a4b213c62c9e6dd38e
parent038e43d19dff736a818125db695699ad63437704 (diff)
Update forward to be synchronous and ignore the reply
-rw-r--r--ext/bg/js/backend.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/ext/bg/js/backend.js b/ext/bg/js/backend.js
index 8f494166..31d29a20 100644
--- a/ext/bg/js/backend.js
+++ b/ext/bg/js/backend.js
@@ -94,7 +94,7 @@ class Backend {
['commandExec', {handler: this._onApiCommandExec.bind(this), async: false}],
['audioGetUri', {handler: this._onApiAudioGetUri.bind(this), async: true}],
['screenshotGet', {handler: this._onApiScreenshotGet.bind(this), async: true}],
- ['forward', {handler: this._onApiForward.bind(this), async: true}],
+ ['forward', {handler: this._onApiForward.bind(this), async: false}],
['frameInformationGet', {handler: this._onApiFrameInformationGet.bind(this), async: true}],
['injectStylesheet', {handler: this._onApiInjectStylesheet.bind(this), async: true}],
['getEnvironmentInfo', {handler: this._onApiGetEnvironmentInfo.bind(this), async: true}],
@@ -569,13 +569,13 @@ class Backend {
_onApiForward({action, params}, sender) {
if (!(sender && sender.tab)) {
- return Promise.resolve();
+ return false;
}
const tabId = sender.tab.id;
- return new Promise((resolve) => {
- chrome.tabs.sendMessage(tabId, {action, params}, (response) => resolve(response));
- });
+ const callback = () => this.checkLastError(chrome.runtime.lastError);
+ chrome.tabs.sendMessage(tabId, {action, params}, callback);
+ return true;
}
_onApiFrameInformationGet(params, sender) {