Move apiForward implementation into Backend
This commit is contained in:
parent
d8b21606ba
commit
daff44a010
@ -78,14 +78,7 @@ function apiScreenshotGet(options, sender) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function apiForward(action, params, sender) {
|
function apiForward(action, params, sender) {
|
||||||
if (!(sender && sender.tab)) {
|
return utilBackend()._onApiForward({action, params}, sender);
|
||||||
return Promise.resolve();
|
|
||||||
}
|
|
||||||
|
|
||||||
const tabId = sender.tab.id;
|
|
||||||
return new Promise((resolve) => {
|
|
||||||
chrome.tabs.sendMessage(tabId, {action, params}, (response) => resolve(response));
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function apiFrameInformationGet(sender) {
|
function apiFrameInformationGet(sender) {
|
||||||
|
@ -420,7 +420,14 @@ class Backend {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_onApiForward({action, params}, sender) {
|
_onApiForward({action, params}, sender) {
|
||||||
return apiForward(action, params, sender);
|
if (!(sender && sender.tab)) {
|
||||||
|
return Promise.resolve();
|
||||||
|
}
|
||||||
|
|
||||||
|
const tabId = sender.tab.id;
|
||||||
|
return new Promise((resolve) => {
|
||||||
|
chrome.tabs.sendMessage(tabId, {action, params}, (response) => resolve(response));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
_onApiFrameInformationGet(params, sender) {
|
_onApiFrameInformationGet(params, sender) {
|
||||||
|
Loading…
Reference in New Issue
Block a user