aboutsummaryrefslogtreecommitdiff
path: root/ext/bg
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2021-02-08 17:53:02 -0500
committerGitHub <noreply@github.com>2021-02-08 17:53:02 -0500
commitbb8a521dff8ee314ab71bceb4bb2dcbe82b7a547 (patch)
treec4926c6d92a04ff1feb75fbbc40a3ebc99cbe13a /ext/bg
parent73e91b3b62f5ca07bcf2bf66e54e0d16af73dd42 (diff)
Remove unused api functions (#1354)
* Remove screenshotGet * Remove downloadDefinitionAudio * Remove clipboardGetImage
Diffstat (limited to 'ext/bg')
-rw-r--r--ext/bg/js/backend.js29
1 files changed, 0 insertions, 29 deletions
diff --git a/ext/bg/js/backend.js b/ext/bg/js/backend.js
index 4a3b7663..55905fab 100644
--- a/ext/bg/js/backend.js
+++ b/ext/bg/js/backend.js
@@ -100,8 +100,6 @@ class Backend {
['suspendAnkiCardsForNote', {async: true, contentScript: true, handler: this._onApiSuspendAnkiCardsForNote.bind(this)}],
['commandExec', {async: false, contentScript: true, handler: this._onApiCommandExec.bind(this)}],
['getExpressionAudioInfoList', {async: true, contentScript: true, handler: this._onApiGetExpressionAudioInfoList.bind(this)}],
- ['downloadDefinitionAudio', {async: true, contentScript: true, handler: this._onApiDownloadDefinitionAudio.bind(this)}],
- ['screenshotGet', {async: true, contentScript: true, handler: this._onApiScreenshotGet.bind(this)}],
['sendMessageToFrame', {async: false, contentScript: true, handler: this._onApiSendMessageToFrame.bind(this)}],
['broadcastTab', {async: false, contentScript: true, handler: this._onApiBroadcastTab.bind(this)}],
['frameInformationGet', {async: true, contentScript: true, handler: this._onApiFrameInformationGet.bind(this)}],
@@ -109,7 +107,6 @@ class Backend {
['getStylesheetContent', {async: true, contentScript: true, handler: this._onApiGetStylesheetContent.bind(this)}],
['getEnvironmentInfo', {async: false, contentScript: true, handler: this._onApiGetEnvironmentInfo.bind(this)}],
['clipboardGet', {async: true, contentScript: true, handler: this._onApiClipboardGet.bind(this)}],
- ['clipboardGetImage', {async: true, contentScript: true, handler: this._onApiClipboardImageGet.bind(this)}],
['getDisplayTemplatesHtml', {async: true, contentScript: true, handler: this._onApiGetDisplayTemplatesHtml.bind(this)}],
['getZoom', {async: true, contentScript: true, handler: this._onApiGetZoom.bind(this)}],
['getDefaultAnkiFieldTemplates', {async: false, contentScript: true, handler: this._onApiGetDefaultAnkiFieldTemplates.bind(this)}],
@@ -504,28 +501,6 @@ class Backend {
return await this._audioDownloader.getExpressionAudioInfoList(source, expression, reading, details);
}
- async _onApiDownloadDefinitionAudio({sources, expression, reading, details}) {
- return await this._downloadDefinitionAudio(sources, expression, reading, details);
- }
-
- _onApiScreenshotGet({options}, sender) {
- if (!(sender && sender.tab)) {
- return Promise.resolve();
- }
-
- const windowId = sender.tab.windowId;
- return new Promise((resolve, reject) => {
- chrome.tabs.captureVisibleTab(windowId, options, (dataUrl) => {
- const e = chrome.runtime.lastError;
- if (e) {
- reject(new Error(e.message));
- } else {
- resolve(dataUrl);
- }
- });
- });
- }
-
_onApiSendMessageToFrame({frameId: targetFrameId, action, params}, sender) {
if (!(sender && sender.tab)) {
return false;
@@ -572,10 +547,6 @@ class Backend {
return this._clipboardReader.getText();
}
- async _onApiClipboardImageGet() {
- return this._clipboardReader.getImage();
- }
-
async _onApiGetDisplayTemplatesHtml() {
return await this._fetchAsset('/mixed/display-templates.html');
}