Remove unused functions from backend.js (#1014)

This commit is contained in:
toasted-nutbread 2020-11-08 17:06:44 -05:00 committed by GitHub
parent 6232e3efc2
commit 681065e554
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1255,11 +1255,6 @@ class Backend {
return false;
}
_getTemplates(options) {
const templates = options.anki.fieldTemplates;
return typeof templates === 'string' ? templates : this._defaultAnkiFieldTemplates;
}
async _getTabUrl(tabId) {
try {
const {url} = await this._sendMessageTabPromise(
@ -1462,23 +1457,6 @@ class Backend {
return isValidTab ? tab : null;
}
_environmentHasDocument() {
return (typeof document === 'object' && document !== null);
}
_executePasteCommand() {
document.execCommand('paste');
}
_readFileAsDataURL(file) {
return new Promise((resolve, reject) => {
const reader = new FileReader();
reader.onload = () => resolve(reader.result);
reader.onerror = () => reject(reader.error);
reader.readAsDataURL(file);
});
}
async _getScreenshot(windowId, tabId, ownerFrameId, format, quality) {
if (typeof windowId !== 'number') {
throw new Error('Invalid window ID');