diff options
Diffstat (limited to 'ext/js/background/backend.js')
-rw-r--r-- | ext/js/background/backend.js | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/ext/js/background/backend.js b/ext/js/background/backend.js index b9e1f51b..e76f4cfe 100644 --- a/ext/js/background/backend.js +++ b/ext/js/background/backend.js @@ -125,7 +125,8 @@ class Backend { ['triggerDatabaseUpdated', {async: false, contentScript: true, handler: this._onApiTriggerDatabaseUpdated.bind(this)}], ['testMecab', {async: true, contentScript: true, handler: this._onApiTestMecab.bind(this)}], ['textHasJapaneseCharacters', {async: false, contentScript: true, handler: this._onApiTextHasJapaneseCharacters.bind(this)}], - ['documentStart', {async: false, contentScript: true, handler: this._onApiDocumentStart.bind(this)}] + ['documentStart', {async: false, contentScript: true, handler: this._onApiDocumentStart.bind(this)}], + ['getTermFrequencies', {async: true, contentScript: true, handler: this._onApiGetTermFrequencies.bind(this)}] ]); this._messageHandlersWithProgress = new Map([ ]); @@ -748,6 +749,10 @@ class Backend { this._updateTabAccessibility(url, tab, frameId); } + async _onApiGetTermFrequencies({termReadingList, dictionaries}) { + return await this._translator.getTermFrequencies(termReadingList, dictionaries); + } + // Command handlers async _onCommandOpenSearchPage(params) { @@ -1953,7 +1958,7 @@ class Backend { const {wildcard} = details; const enabledDictionaryMap = this._getTranslatorEnabledDictionaryMap(options); const { - general: {mainDictionary}, + general: {mainDictionary, sortFrequencyDictionary, sortFrequencyDictionaryOrder}, scanning: {alphanumeric}, translation: { convertHalfWidthCharacters, @@ -1979,6 +1984,8 @@ class Backend { return { wildcard, mainDictionary, + sortFrequencyDictionary, + sortFrequencyDictionaryOrder, removeNonJapaneseCharacters: !alphanumeric, convertHalfWidthCharacters, convertNumericCharacters, |