aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/api.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-12-09 21:54:03 -0500
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-12-13 23:11:56 -0500
commitd8b21606ba0f8878b718aef332c6616931e99dd0 (patch)
treeba163cd4327b605d1f388217af0947c80f03ab4b /ext/bg/js/api.js
parent1202ad261eba2c684351ba4b9a53e68203a8ae45 (diff)
Move apiScreenshotGet implementation into Backend
Diffstat (limited to 'ext/bg/js/api.js')
-rw-r--r--ext/bg/js/api.js9
1 files changed, 1 insertions, 8 deletions
diff --git a/ext/bg/js/api.js b/ext/bg/js/api.js
index db849cc5..3b9af593 100644
--- a/ext/bg/js/api.js
+++ b/ext/bg/js/api.js
@@ -74,14 +74,7 @@ function apiAudioGetUrl(definition, source, optionsContext) {
}
function apiScreenshotGet(options, sender) {
- if (!(sender && sender.tab)) {
- return Promise.resolve();
- }
-
- const windowId = sender.tab.windowId;
- return new Promise((resolve) => {
- chrome.tabs.captureVisibleTab(windowId, options, (dataUrl) => resolve(dataUrl));
- });
+ return utilBackend()._onApiScreenshotGet({options}, sender);
}
function apiForward(action, params, sender) {