diff options
Diffstat (limited to 'ext/js/background')
-rw-r--r-- | ext/js/background/backend.js | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/ext/js/background/backend.js b/ext/js/background/backend.js index f3568694..a2a93375 100644 --- a/ext/js/background/backend.js +++ b/ext/js/background/backend.js @@ -47,13 +47,11 @@ class Backend { }); this._anki = new AnkiConnect(); this._mecab = new Mecab(); - this._mediaUtil = new MediaUtil(); this._clipboardReader = new ClipboardReader({ // eslint-disable-next-line no-undef document: (typeof document === 'object' && document !== null ? document : null), pasteTargetSelector: '#clipboard-paste-target', - imagePasteTargetSelector: '#clipboard-image-paste-target', - mediaUtil: this._mediaUtil + imagePasteTargetSelector: '#clipboard-image-paste-target' }); this._clipboardMonitor = new ClipboardMonitor({ japaneseUtil: this._japaneseUtil, @@ -1750,7 +1748,7 @@ class Backend { return null; } - let extension = this._mediaUtil.getFileExtensionFromAudioMediaType(contentType); + let extension = MediaUtil.getFileExtensionFromAudioMediaType(contentType); if (extension === null) { extension = '.mp3'; } let fileName = this._generateAnkiNoteMediaFileName('yomichan_audio', extension, timestamp, definitionDetails); fileName = fileName.replace(/\]/g, ''); @@ -1764,7 +1762,7 @@ class Backend { const dataUrl = await this._getScreenshot(tabId, frameId, format, quality); const {mediaType, data} = this._getDataUrlInfo(dataUrl); - const extension = this._mediaUtil.getFileExtensionFromImageMediaType(mediaType); + const extension = MediaUtil.getFileExtensionFromImageMediaType(mediaType); if (extension === null) { throw new Error('Unknown media type for screenshot image'); } @@ -1782,7 +1780,7 @@ class Backend { } const {mediaType, data} = this._getDataUrlInfo(dataUrl); - const extension = this._mediaUtil.getFileExtensionFromImageMediaType(mediaType); + const extension = MediaUtil.getFileExtensionFromImageMediaType(mediaType); if (extension === null) { throw new Error('Unknown media type for clipboard image'); } |