From 82462edce0215e4de14ce7d9348304b2c2ca6a4d Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Tue, 7 Apr 2020 19:41:02 -0400 Subject: Add support for API handlers to be optionally asynchronous --- ext/bg/js/backend.js | 77 ++++++++++++++++++++++++++++------------------------ 1 file changed, 42 insertions(+), 35 deletions(-) (limited to 'ext/bg/js/backend.js') diff --git a/ext/bg/js/backend.js b/ext/bg/js/backend.js index 1fa7ede1..ed4a24ed 100644 --- a/ext/bg/js/backend.js +++ b/ext/bg/js/backend.js @@ -77,33 +77,33 @@ class Backend { this.messageToken = yomichan.generateId(16); this._messageHandlers = new Map([ - ['yomichanCoreReady', this._onApiYomichanCoreReady.bind(this)], - ['optionsSchemaGet', this._onApiOptionsSchemaGet.bind(this)], - ['optionsGet', this._onApiOptionsGet.bind(this)], - ['optionsGetFull', this._onApiOptionsGetFull.bind(this)], - ['optionsSet', this._onApiOptionsSet.bind(this)], - ['optionsSave', this._onApiOptionsSave.bind(this)], - ['kanjiFind', this._onApiKanjiFind.bind(this)], - ['termsFind', this._onApiTermsFind.bind(this)], - ['textParse', this._onApiTextParse.bind(this)], - ['textParseMecab', this._onApiTextParseMecab.bind(this)], - ['definitionAdd', this._onApiDefinitionAdd.bind(this)], - ['definitionsAddable', this._onApiDefinitionsAddable.bind(this)], - ['noteView', this._onApiNoteView.bind(this)], - ['templateRender', this._onApiTemplateRender.bind(this)], - ['commandExec', this._onApiCommandExec.bind(this)], - ['audioGetUri', this._onApiAudioGetUri.bind(this)], - ['screenshotGet', this._onApiScreenshotGet.bind(this)], - ['forward', this._onApiForward.bind(this)], - ['frameInformationGet', this._onApiFrameInformationGet.bind(this)], - ['injectStylesheet', this._onApiInjectStylesheet.bind(this)], - ['getEnvironmentInfo', this._onApiGetEnvironmentInfo.bind(this)], - ['clipboardGet', this._onApiClipboardGet.bind(this)], - ['getDisplayTemplatesHtml', this._onApiGetDisplayTemplatesHtml.bind(this)], - ['getQueryParserTemplatesHtml', this._onApiGetQueryParserTemplatesHtml.bind(this)], - ['getZoom', this._onApiGetZoom.bind(this)], - ['getMessageToken', this._onApiGetMessageToken.bind(this)], - ['getDefaultAnkiFieldTemplates', this._onApiGetDefaultAnkiFieldTemplates.bind(this)] + ['yomichanCoreReady', {handler: this._onApiYomichanCoreReady.bind(this), async: true}], + ['optionsSchemaGet', {handler: this._onApiOptionsSchemaGet.bind(this), async: true}], + ['optionsGet', {handler: this._onApiOptionsGet.bind(this), async: true}], + ['optionsGetFull', {handler: this._onApiOptionsGetFull.bind(this), async: true}], + ['optionsSet', {handler: this._onApiOptionsSet.bind(this), async: true}], + ['optionsSave', {handler: this._onApiOptionsSave.bind(this), async: true}], + ['kanjiFind', {handler: this._onApiKanjiFind.bind(this), async: true}], + ['termsFind', {handler: this._onApiTermsFind.bind(this), async: true}], + ['textParse', {handler: this._onApiTextParse.bind(this), async: true}], + ['textParseMecab', {handler: this._onApiTextParseMecab.bind(this), async: true}], + ['definitionAdd', {handler: this._onApiDefinitionAdd.bind(this), async: true}], + ['definitionsAddable', {handler: this._onApiDefinitionsAddable.bind(this), async: true}], + ['noteView', {handler: this._onApiNoteView.bind(this), async: true}], + ['templateRender', {handler: this._onApiTemplateRender.bind(this), async: true}], + ['commandExec', {handler: this._onApiCommandExec.bind(this), async: true}], + ['audioGetUri', {handler: this._onApiAudioGetUri.bind(this), async: true}], + ['screenshotGet', {handler: this._onApiScreenshotGet.bind(this), async: true}], + ['forward', {handler: this._onApiForward.bind(this), async: true}], + ['frameInformationGet', {handler: this._onApiFrameInformationGet.bind(this), async: true}], + ['injectStylesheet', {handler: this._onApiInjectStylesheet.bind(this), async: true}], + ['getEnvironmentInfo', {handler: this._onApiGetEnvironmentInfo.bind(this), async: true}], + ['clipboardGet', {handler: this._onApiClipboardGet.bind(this), async: true}], + ['getDisplayTemplatesHtml', {handler: this._onApiGetDisplayTemplatesHtml.bind(this), async: true}], + ['getQueryParserTemplatesHtml', {handler: this._onApiGetQueryParserTemplatesHtml.bind(this), async: true}], + ['getZoom', {handler: this._onApiGetZoom.bind(this), async: true}], + ['getMessageToken', {handler: this._onApiGetMessageToken.bind(this), async: true}], + ['getDefaultAnkiFieldTemplates', {handler: this._onApiGetDefaultAnkiFieldTemplates.bind(this), async: true}] ]); this._commandHandlers = new Map([ @@ -167,16 +167,23 @@ class Backend { } onMessage({action, params}, sender, callback) { - const handler = this._messageHandlers.get(action); - if (typeof handler !== 'function') { return false; } + const messageHandler = this._messageHandlers.get(action); + if (typeof messageHandler === 'undefined') { return false; } + + const {handler, async} = messageHandler; try { - const promise = handler(params, sender); - promise.then( - (result) => callback({result}), - (error) => callback({error: errorToJson(error)}) - ); - return true; + const promiseOrResult = handler(params, sender); + if (async) { + promiseOrResult.then( + (result) => callback({result}), + (error) => callback({error: errorToJson(error)}) + ); + return true; + } else { + callback({result: promiseOrResult}); + return false; + } } catch (error) { callback({error: errorToJson(error)}); return false; -- cgit v1.2.3 From 038e43d19dff736a818125db695699ad63437704 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Tue, 7 Apr 2020 19:47:46 -0400 Subject: Update some API handlers to be synchronous --- ext/bg/js/backend.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'ext/bg/js/backend.js') diff --git a/ext/bg/js/backend.js b/ext/bg/js/backend.js index ed4a24ed..8f494166 100644 --- a/ext/bg/js/backend.js +++ b/ext/bg/js/backend.js @@ -78,9 +78,9 @@ class Backend { this._messageHandlers = new Map([ ['yomichanCoreReady', {handler: this._onApiYomichanCoreReady.bind(this), async: true}], - ['optionsSchemaGet', {handler: this._onApiOptionsSchemaGet.bind(this), async: true}], - ['optionsGet', {handler: this._onApiOptionsGet.bind(this), async: true}], - ['optionsGetFull', {handler: this._onApiOptionsGetFull.bind(this), async: true}], + ['optionsSchemaGet', {handler: this._onApiOptionsSchemaGet.bind(this), async: false}], + ['optionsGet', {handler: this._onApiOptionsGet.bind(this), async: false}], + ['optionsGetFull', {handler: this._onApiOptionsGetFull.bind(this), async: false}], ['optionsSet', {handler: this._onApiOptionsSet.bind(this), async: true}], ['optionsSave', {handler: this._onApiOptionsSave.bind(this), async: true}], ['kanjiFind', {handler: this._onApiKanjiFind.bind(this), async: true}], @@ -91,7 +91,7 @@ class Backend { ['definitionsAddable', {handler: this._onApiDefinitionsAddable.bind(this), async: true}], ['noteView', {handler: this._onApiNoteView.bind(this), async: true}], ['templateRender', {handler: this._onApiTemplateRender.bind(this), async: true}], - ['commandExec', {handler: this._onApiCommandExec.bind(this), async: true}], + ['commandExec', {handler: this._onApiCommandExec.bind(this), async: false}], ['audioGetUri', {handler: this._onApiAudioGetUri.bind(this), async: true}], ['screenshotGet', {handler: this._onApiScreenshotGet.bind(this), async: true}], ['forward', {handler: this._onApiForward.bind(this), async: true}], @@ -102,8 +102,8 @@ class Backend { ['getDisplayTemplatesHtml', {handler: this._onApiGetDisplayTemplatesHtml.bind(this), async: true}], ['getQueryParserTemplatesHtml', {handler: this._onApiGetQueryParserTemplatesHtml.bind(this), async: true}], ['getZoom', {handler: this._onApiGetZoom.bind(this), async: true}], - ['getMessageToken', {handler: this._onApiGetMessageToken.bind(this), async: true}], - ['getDefaultAnkiFieldTemplates', {handler: this._onApiGetDefaultAnkiFieldTemplates.bind(this), async: true}] + ['getMessageToken', {handler: this._onApiGetMessageToken.bind(this), async: false}], + ['getDefaultAnkiFieldTemplates', {handler: this._onApiGetDefaultAnkiFieldTemplates.bind(this), async: false}] ]); this._commandHandlers = new Map([ @@ -332,15 +332,15 @@ class Backend { }); } - async _onApiOptionsSchemaGet() { + _onApiOptionsSchemaGet() { return this.getOptionsSchema(); } - async _onApiOptionsGet({optionsContext}) { + _onApiOptionsGet({optionsContext}) { return this.getOptions(optionsContext); } - async _onApiOptionsGetFull() { + _onApiOptionsGetFull() { return this.getFullOptions(); } @@ -547,7 +547,7 @@ class Backend { return this._renderTemplate(template, data); } - async _onApiCommandExec({command, params}) { + _onApiCommandExec({command, params}) { return this._runCommand(command, params); } @@ -698,11 +698,11 @@ class Backend { }); } - async _onApiGetMessageToken() { + _onApiGetMessageToken() { return this.messageToken; } - async _onApiGetDefaultAnkiFieldTemplates() { + _onApiGetDefaultAnkiFieldTemplates() { return this.defaultAnkiFieldTemplates; } -- cgit v1.2.3 From 96566b8581549adba7cd24f37537fd7910eb8d37 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Tue, 7 Apr 2020 19:49:54 -0400 Subject: Update forward to be synchronous and ignore the reply --- ext/bg/js/backend.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'ext/bg/js/backend.js') diff --git a/ext/bg/js/backend.js b/ext/bg/js/backend.js index 8f494166..31d29a20 100644 --- a/ext/bg/js/backend.js +++ b/ext/bg/js/backend.js @@ -94,7 +94,7 @@ class Backend { ['commandExec', {handler: this._onApiCommandExec.bind(this), async: false}], ['audioGetUri', {handler: this._onApiAudioGetUri.bind(this), async: true}], ['screenshotGet', {handler: this._onApiScreenshotGet.bind(this), async: true}], - ['forward', {handler: this._onApiForward.bind(this), async: true}], + ['forward', {handler: this._onApiForward.bind(this), async: false}], ['frameInformationGet', {handler: this._onApiFrameInformationGet.bind(this), async: true}], ['injectStylesheet', {handler: this._onApiInjectStylesheet.bind(this), async: true}], ['getEnvironmentInfo', {handler: this._onApiGetEnvironmentInfo.bind(this), async: true}], @@ -569,13 +569,13 @@ class Backend { _onApiForward({action, params}, sender) { if (!(sender && sender.tab)) { - return Promise.resolve(); + return false; } const tabId = sender.tab.id; - return new Promise((resolve) => { - chrome.tabs.sendMessage(tabId, {action, params}, (response) => resolve(response)); - }); + const callback = () => this.checkLastError(chrome.runtime.lastError); + chrome.tabs.sendMessage(tabId, {action, params}, callback); + return true; } _onApiFrameInformationGet(params, sender) { -- cgit v1.2.3 From a2b66dc6cc3bd0d037c050eb49e270189a6617fb Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Tue, 7 Apr 2020 19:51:39 -0400 Subject: Rename apiForward to apiBroadcast --- ext/bg/js/backend.js | 4 ++-- ext/fg/js/float.js | 6 +++--- ext/fg/js/frame-offset-forwarder.js | 4 ++-- ext/fg/js/frontend-initialize.js | 4 ++-- ext/fg/js/frontend.js | 6 +++--- ext/mixed/js/api.js | 4 ++-- ext/mixed/js/display.js | 4 ++-- 7 files changed, 16 insertions(+), 16 deletions(-) (limited to 'ext/bg/js/backend.js') diff --git a/ext/bg/js/backend.js b/ext/bg/js/backend.js index 31d29a20..c471c594 100644 --- a/ext/bg/js/backend.js +++ b/ext/bg/js/backend.js @@ -94,7 +94,7 @@ class Backend { ['commandExec', {handler: this._onApiCommandExec.bind(this), async: false}], ['audioGetUri', {handler: this._onApiAudioGetUri.bind(this), async: true}], ['screenshotGet', {handler: this._onApiScreenshotGet.bind(this), async: true}], - ['forward', {handler: this._onApiForward.bind(this), async: false}], + ['broadcast', {handler: this._onApiBroadcast.bind(this), async: false}], ['frameInformationGet', {handler: this._onApiFrameInformationGet.bind(this), async: true}], ['injectStylesheet', {handler: this._onApiInjectStylesheet.bind(this), async: true}], ['getEnvironmentInfo', {handler: this._onApiGetEnvironmentInfo.bind(this), async: true}], @@ -567,7 +567,7 @@ class Backend { }); } - _onApiForward({action, params}, sender) { + _onApiBroadcast({action, params}, sender) { if (!(sender && sender.tab)) { return false; } diff --git a/ext/fg/js/float.js b/ext/fg/js/float.js index 01055ca6..8c00d0a5 100644 --- a/ext/fg/js/float.js +++ b/ext/fg/js/float.js @@ -18,7 +18,7 @@ /* global * Display - * apiForward + * apiBroadcast * apiGetMessageToken * popupNestedInitialize */ @@ -80,7 +80,7 @@ class DisplayFloat extends Display { this.setContentScale(scale); - apiForward('popupPrepareCompleted', {targetPopupId: this._popupId}); + apiBroadcast('popupPrepareCompleted', {targetPopupId: this._popupId}); } onError(error) { @@ -181,7 +181,7 @@ class DisplayFloat extends Display { }, 2000 ); - apiForward('requestDocumentInformationBroadcast', {uniqueId}); + apiBroadcast('requestDocumentInformationBroadcast', {uniqueId}); const {title} = await promise; return title; diff --git a/ext/fg/js/frame-offset-forwarder.js b/ext/fg/js/frame-offset-forwarder.js index 7b417b6e..88c1b72c 100644 --- a/ext/fg/js/frame-offset-forwarder.js +++ b/ext/fg/js/frame-offset-forwarder.js @@ -17,7 +17,7 @@ */ /* global - * apiForward + * apiBroadcast */ class FrameOffsetForwarder { @@ -97,6 +97,6 @@ class FrameOffsetForwarder { } _forwardFrameOffsetOrigin(offset, uniqueId) { - apiForward('frameOffset', {offset, uniqueId}); + apiBroadcast('frameOffset', {offset, uniqueId}); } } diff --git a/ext/fg/js/frontend-initialize.js b/ext/fg/js/frontend-initialize.js index 4a1409db..d2572746 100644 --- a/ext/fg/js/frontend-initialize.js +++ b/ext/fg/js/frontend-initialize.js @@ -21,7 +21,7 @@ * Frontend * PopupProxy * PopupProxyHost - * apiForward + * apiBroadcast * apiOptionsGet */ @@ -44,7 +44,7 @@ async function main() { } } ); - apiForward('rootPopupRequestInformationBroadcast'); + apiBroadcast('rootPopupRequestInformationBroadcast'); const {popupId, frameId} = await rootPopupInformationPromise; const frameOffsetForwarder = new FrameOffsetForwarder(); diff --git a/ext/fg/js/frontend.js b/ext/fg/js/frontend.js index 31843212..bcb0b84a 100644 --- a/ext/fg/js/frontend.js +++ b/ext/fg/js/frontend.js @@ -18,7 +18,7 @@ /* global * TextScanner - * apiForward + * apiBroadcast * apiGetZoom * apiKanjiFind * apiOptionsGet @@ -261,12 +261,12 @@ class Frontend extends TextScanner { _broadcastRootPopupInformation() { if (!this.popup.isProxy() && this.popup.depth === 0) { - apiForward('rootPopupInformation', {popupId: this.popup.id, frameId: this.popup.frameId}); + apiBroadcast('rootPopupInformation', {popupId: this.popup.id, frameId: this.popup.frameId}); } } _broadcastDocumentInformation(uniqueId) { - apiForward('documentInformationBroadcast', { + apiBroadcast('documentInformationBroadcast', { uniqueId, frameId: this.popup.frameId, title: document.title diff --git a/ext/mixed/js/api.js b/ext/mixed/js/api.js index feec94df..d28e3ab6 100644 --- a/ext/mixed/js/api.js +++ b/ext/mixed/js/api.js @@ -81,8 +81,8 @@ function apiScreenshotGet(options) { return _apiInvoke('screenshotGet', {options}); } -function apiForward(action, params) { - return _apiInvoke('forward', {action, params}); +function apiBroadcast(action, params) { + return _apiInvoke('broadcast', {action, params}); } function apiFrameInformationGet() { diff --git a/ext/mixed/js/display.js b/ext/mixed/js/display.js index 2f456c3e..710674b2 100644 --- a/ext/mixed/js/display.js +++ b/ext/mixed/js/display.js @@ -23,9 +23,9 @@ * DisplayGenerator * WindowScroll * apiAudioGetUri + * apiBroadcast * apiDefinitionAdd * apiDefinitionsAddable - * apiForward * apiKanjiFind * apiNoteView * apiOptionsGet @@ -855,7 +855,7 @@ class Display { } setPopupVisibleOverride(visible) { - return apiForward('popupSetVisibleOverride', {visible}); + return apiBroadcast('popupSetVisibleOverride', {visible}); } setSpinnerVisible(visible) { -- cgit v1.2.3 From c88ec43ad1523fefaa47b6e46dd0fa95f342559c Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Tue, 7 Apr 2020 19:59:10 -0400 Subject: Fix yomichanCoreReady waiting for a response --- ext/bg/js/backend.js | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'ext/bg/js/backend.js') diff --git a/ext/bg/js/backend.js b/ext/bg/js/backend.js index c471c594..35e75bbe 100644 --- a/ext/bg/js/backend.js +++ b/ext/bg/js/backend.js @@ -77,7 +77,7 @@ class Backend { this.messageToken = yomichan.generateId(16); this._messageHandlers = new Map([ - ['yomichanCoreReady', {handler: this._onApiYomichanCoreReady.bind(this), async: true}], + ['yomichanCoreReady', {handler: this._onApiYomichanCoreReady.bind(this), async: false}], ['optionsSchemaGet', {handler: this._onApiOptionsSchemaGet.bind(this), async: false}], ['optionsGet', {handler: this._onApiOptionsGet.bind(this), async: false}], ['optionsGetFull', {handler: this._onApiOptionsGetFull.bind(this), async: false}], @@ -320,16 +320,15 @@ class Backend { _onApiYomichanCoreReady(_params, sender) { // tab ID isn't set in background (e.g. browser_action) + const callback = () => this.checkLastError(chrome.runtime.lastError); + const data = {action: 'backendPrepared'}; if (typeof sender.tab === 'undefined') { - const callback = () => this.checkLastError(chrome.runtime.lastError); - chrome.runtime.sendMessage({action: 'backendPrepared'}, callback); - return Promise.resolve(); + chrome.runtime.sendMessage(data, callback); + return false; + } else { + chrome.tabs.sendMessage(sender.tab.id, data, callback); + return true; } - - const tabId = sender.tab.id; - return new Promise((resolve) => { - chrome.tabs.sendMessage(tabId, {action: 'backendPrepared'}, resolve); - }); } _onApiOptionsSchemaGet() { -- cgit v1.2.3 From 4e5029f7ec82aaa99e16bd84a0ec2ad19a15c6b0 Mon Sep 17 00:00:00 2001 From: Alex Yatskov Date: Fri, 10 Apr 2020 11:06:55 -0700 Subject: Update license author field to broader to explicitly reflect that Yomichan is an ongoing community project. It really does take a village, and everyone who contributes code owns a part of it :) --- LICENSE | 2 +- ext/bg/css/settings.css | 3 +-- ext/bg/js/anki-note-builder.js | 3 +-- ext/bg/js/anki.js | 3 +-- ext/bg/js/audio-uri-builder.js | 3 +-- ext/bg/js/backend-api-forwarder.js | 3 +-- ext/bg/js/backend.js | 3 +-- ext/bg/js/clipboard-monitor.js | 3 +-- ext/bg/js/conditions.js | 3 +-- ext/bg/js/context.js | 3 +-- ext/bg/js/database.js | 3 +-- ext/bg/js/deinflector.js | 3 +-- ext/bg/js/dictionary-importer.js | 3 +-- ext/bg/js/dictionary.js | 3 +-- ext/bg/js/handlebars.js | 3 +-- ext/bg/js/japanese.js | 3 +-- ext/bg/js/json-schema.js | 3 +-- ext/bg/js/mecab.js | 3 +-- ext/bg/js/options.js | 3 +-- ext/bg/js/page-exit-prevention.js | 3 +-- ext/bg/js/profile-conditions.js | 3 +-- ext/bg/js/request.js | 3 +-- ext/bg/js/search-frontend.js | 3 +-- ext/bg/js/search-query-parser-generator.js | 3 +-- ext/bg/js/search-query-parser.js | 3 +-- ext/bg/js/search.js | 3 +-- ext/bg/js/settings/anki-templates.js | 3 +-- ext/bg/js/settings/anki.js | 3 +-- ext/bg/js/settings/audio-ui.js | 3 +-- ext/bg/js/settings/audio.js | 3 +-- ext/bg/js/settings/backup.js | 3 +-- ext/bg/js/settings/conditions-ui.js | 3 +-- ext/bg/js/settings/dictionaries.js | 3 +-- ext/bg/js/settings/main.js | 3 +-- ext/bg/js/settings/popup-preview-frame.js | 3 +-- ext/bg/js/settings/popup-preview.js | 3 +-- ext/bg/js/settings/profiles.js | 3 +-- ext/bg/js/settings/storage.js | 3 +-- ext/bg/js/text-source-map.js | 3 +-- ext/bg/js/translator.js | 3 +-- ext/bg/js/util.js | 3 +-- ext/bg/legal.html | 2 +- ext/fg/css/client.css | 3 +-- ext/fg/js/document.js | 3 +-- ext/fg/js/float.js | 3 +-- ext/fg/js/frame-offset-forwarder.js | 3 +-- ext/fg/js/frontend-api-receiver.js | 3 +-- ext/fg/js/frontend-api-sender.js | 3 +-- ext/fg/js/frontend-initialize.js | 3 +-- ext/fg/js/frontend.js | 3 +-- ext/fg/js/popup-nested.js | 3 +-- ext/fg/js/popup-proxy-host.js | 3 +-- ext/fg/js/popup-proxy.js | 3 +-- ext/fg/js/popup.js | 3 +-- ext/fg/js/source.js | 3 +-- ext/mixed/css/display-dark.css | 3 +-- ext/mixed/css/display-default.css | 3 +-- ext/mixed/css/display.css | 3 +-- ext/mixed/js/api.js | 3 +-- ext/mixed/js/audio-system.js | 3 +-- ext/mixed/js/core.js | 3 +-- ext/mixed/js/display-context.js | 3 +-- ext/mixed/js/display-generator.js | 3 +-- ext/mixed/js/display.js | 3 +-- ext/mixed/js/dom.js | 3 +-- ext/mixed/js/japanese.js | 3 +-- ext/mixed/js/object-property-accessor.js | 3 +-- ext/mixed/js/scroll.js | 3 +-- ext/mixed/js/template-handler.js | 3 +-- ext/mixed/js/text-scanner.js | 3 +-- ext/mixed/js/timer.js | 3 +-- test/dictionary-validate.js | 3 +-- test/lint/global-declarations.js | 4 ++-- test/schema-validate.js | 3 +-- test/test-database.js | 3 +-- test/test-dictionary.js | 3 +-- test/test-document.js | 3 +-- test/test-japanese.js | 3 +-- test/test-object-property-accessor.js | 3 +-- test/test-schema.js | 3 +-- test/test-text-source-map.js | 3 +-- test/yomichan-test.js | 3 +-- test/yomichan-vm.js | 3 +-- 83 files changed, 84 insertions(+), 164 deletions(-) (limited to 'ext/bg/js/backend.js') diff --git a/LICENSE b/LICENSE index f8531a9f..23c698c5 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright 2016-2020 Alex Yatskov +Copyright 2016-2020 Yomichan Authors This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/ext/bg/css/settings.css b/ext/bg/css/settings.css index 6344bd38..f55082e7 100644 --- a/ext/bg/css/settings.css +++ b/ext/bg/css/settings.css @@ -1,6 +1,5 @@ /* - * Copyright (C) 2019-2020 Alex Yatskov - * Author: Alex Yatskov + * Copyright (C) 2019-2020 Yomichan Authors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/ext/bg/js/anki-note-builder.js b/ext/bg/js/anki-note-builder.js index 244aaab8..8a707006 100644 --- a/ext/bg/js/anki-note-builder.js +++ b/ext/bg/js/anki-note-builder.js @@ -1,6 +1,5 @@ /* - * Copyright (C) 2020 Alex Yatskov - * Author: Alex Yatskov + * Copyright (C) 2020 Yomichan Authors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/ext/bg/js/anki.js b/ext/bg/js/anki.js index a70388bd..c7f7c0cc 100644 --- a/ext/bg/js/anki.js +++ b/ext/bg/js/anki.js @@ -1,6 +1,5 @@ /* - * Copyright (C) 2016-2020 Alex Yatskov - * Author: Alex Yatskov + * Copyright (C) 2016-2020 Yomichan Authors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/ext/bg/js/audio-uri-builder.js b/ext/bg/js/audio-uri-builder.js index 158006bb..dfd195d8 100644 --- a/ext/bg/js/audio-uri-builder.js +++ b/ext/bg/js/audio-uri-builder.js @@ -1,6 +1,5 @@ /* - * Copyright (C) 2017-2020 Alex Yatskov - * Author: Alex Yatskov + * Copyright (C) 2017-2020 Yomichan Authors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/ext/bg/js/backend-api-forwarder.js b/ext/bg/js/backend-api-forwarder.js index 170a6b32..93db77d7 100644 --- a/ext/bg/js/backend-api-forwarder.js +++ b/ext/bg/js/backend-api-forwarder.js @@ -1,6 +1,5 @@ /* - * Copyright (C) 2019-2020 Alex Yatskov - * Author: Alex Yatskov + * Copyright (C) 2019-2020 Yomichan Authors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/ext/bg/js/backend.js b/ext/bg/js/backend.js index 1fa7ede1..6386319b 100644 --- a/ext/bg/js/backend.js +++ b/ext/bg/js/backend.js @@ -1,6 +1,5 @@ /* - * Copyright (C) 2016-2020 Alex Yatskov - * Author: Alex Yatskov + * Copyright (C) 2016-2020 Yomichan Authors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/ext/bg/js/clipboard-monitor.js b/ext/bg/js/clipboard-monitor.js index c67525fc..e7e7378c 100644 --- a/ext/bg/js/clipboard-monitor.js +++ b/ext/bg/js/clipboard-monitor.js @@ -1,6 +1,5 @@ /* - * Copyright (C) 2020 Alex Yatskov - * Author: Alex Yatskov + * Copyright (C) 2020 Yomichan Authors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/ext/bg/js/conditions.js b/ext/bg/js/conditions.js index d4d1c0e0..eb9582df 100644 --- a/ext/bg/js/conditions.js +++ b/ext/bg/js/conditions.js @@ -1,6 +1,5 @@ /* - * Copyright (C) 2019-2020 Alex Yatskov - * Author: Alex Yatskov + * Copyright (C) 2019-2020 Yomichan Authors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/ext/bg/js/context.js b/ext/bg/js/context.js index c3e74656..e3d4ad4a 100644 --- a/ext/bg/js/context.js +++ b/ext/bg/js/context.js @@ -1,6 +1,5 @@ /* - * Copyright (C) 2017-2020 Alex Yatskov - * Author: Alex Yatskov + * Copyright (C) 2017-2020 Yomichan Authors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/ext/bg/js/database.js b/ext/bg/js/database.js index 4a677fea..ad4e3bad 100644 --- a/ext/bg/js/database.js +++ b/ext/bg/js/database.js @@ -1,6 +1,5 @@ /* - * Copyright (C) 2016-2020 Alex Yatskov - * Author: Alex Yatskov + * Copyright (C) 2016-2020 Yomichan Authors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/ext/bg/js/deinflector.js b/ext/bg/js/deinflector.js index d548d271..6ec6e899 100644 --- a/ext/bg/js/deinflector.js +++ b/ext/bg/js/deinflector.js @@ -1,6 +1,5 @@ /* - * Copyright (C) 2016-2020 Alex Yatskov - * Author: Alex Yatskov + * Copyright (C) 2016-2020 Yomichan Authors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/ext/bg/js/dictionary-importer.js b/ext/bg/js/dictionary-importer.js index 254fde4f..bf6809ec 100644 --- a/ext/bg/js/dictionary-importer.js +++ b/ext/bg/js/dictionary-importer.js @@ -1,6 +1,5 @@ /* - * Copyright (C) 2020 Alex Yatskov - * Author: Alex Yatskov + * Copyright (C) 2020 Yomichan Authors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/ext/bg/js/dictionary.js b/ext/bg/js/dictionary.js index 74bd5a64..15cc7615 100644 --- a/ext/bg/js/dictionary.js +++ b/ext/bg/js/dictionary.js @@ -1,6 +1,5 @@ /* - * Copyright (C) 2016-2020 Alex Yatskov - * Author: Alex Yatskov + * Copyright (C) 2016-2020 Yomichan Authors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/ext/bg/js/handlebars.js b/ext/bg/js/handlebars.js index 5fda5baa..860acb14 100644 --- a/ext/bg/js/handlebars.js +++ b/ext/bg/js/handlebars.js @@ -1,6 +1,5 @@ /* - * Copyright (C) 2016-2020 Alex Yatskov - * Author: Alex Yatskov + * Copyright (C) 2016-2020 Yomichan Authors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/ext/bg/js/japanese.js b/ext/bg/js/japanese.js index 2a2b39fd..5c49cca7 100644 --- a/ext/bg/js/japanese.js +++ b/ext/bg/js/japanese.js @@ -1,6 +1,5 @@ /* - * Copyright (C) 2016-2020 Alex Yatskov - * Author: Alex Yatskov + * Copyright (C) 2016-2020 Yomichan Authors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/ext/bg/js/json-schema.js b/ext/bg/js/json-schema.js index 58f804fd..f62402f9 100644 --- a/ext/bg/js/json-schema.js +++ b/ext/bg/js/json-schema.js @@ -1,6 +1,5 @@ /* - * Copyright (C) 2019-2020 Alex Yatskov - * Author: Alex Yatskov + * Copyright (C) 2019-2020 Yomichan Authors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/ext/bg/js/mecab.js b/ext/bg/js/mecab.js index 34ecd728..cd6e6c57 100644 --- a/ext/bg/js/mecab.js +++ b/ext/bg/js/mecab.js @@ -1,6 +1,5 @@ /* - * Copyright (C) 2019-2020 Alex Yatskov - * Author: Alex Yatskov + * Copyright (C) 2019-2020 Yomichan Authors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/ext/bg/js/options.js b/ext/bg/js/options.js index abb054d4..20df2a68 100644 --- a/ext/bg/js/options.js +++ b/ext/bg/js/options.js @@ -1,6 +1,5 @@ /* - * Copyright (C) 2016-2020 Alex Yatskov - * Author: Alex Yatskov + * Copyright (C) 2016-2020 Yomichan Authors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/ext/bg/js/page-exit-prevention.js b/ext/bg/js/page-exit-prevention.js index be06c495..f55cf024 100644 --- a/ext/bg/js/page-exit-prevention.js +++ b/ext/bg/js/page-exit-prevention.js @@ -1,6 +1,5 @@ /* - * Copyright (C) 2019-2020 Alex Yatskov - * Author: Alex Yatskov + * Copyright (C) 2019-2020 Yomichan Authors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/ext/bg/js/profile-conditions.js b/ext/bg/js/profile-conditions.js index 1fd78e5d..a0710bd1 100644 --- a/ext/bg/js/profile-conditions.js +++ b/ext/bg/js/profile-conditions.js @@ -1,6 +1,5 @@ /* - * Copyright (C) 2019-2020 Alex Yatskov - * Author: Alex Yatskov + * Copyright (C) 2019-2020 Yomichan Authors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/ext/bg/js/request.js b/ext/bg/js/request.js index 02eed6fb..957ac0f5 100644 --- a/ext/bg/js/request.js +++ b/ext/bg/js/request.js @@ -1,6 +1,5 @@ /* - * Copyright (C) 2017-2020 Alex Yatskov - * Author: Alex Yatskov + * Copyright (C) 2017-2020 Yomichan Authors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/ext/bg/js/search-frontend.js b/ext/bg/js/search-frontend.js index f130a6fa..9cc1436f 100644 --- a/ext/bg/js/search-frontend.js +++ b/ext/bg/js/search-frontend.js @@ -1,6 +1,5 @@ /* - * Copyright (C) 2019-2020 Alex Yatskov - * Author: Alex Yatskov + * Copyright (C) 2019-2020 Yomichan Authors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/ext/bg/js/search-query-parser-generator.js b/ext/bg/js/search-query-parser-generator.js index 664858a4..390841c1 100644 --- a/ext/bg/js/search-query-parser-generator.js +++ b/ext/bg/js/search-query-parser-generator.js @@ -1,6 +1,5 @@ /* - * Copyright (C) 2020 Alex Yatskov - * Author: Alex Yatskov + * Copyright (C) 2020 Yomichan Authors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/ext/bg/js/search-query-parser.js b/ext/bg/js/search-query-parser.js index 9f59f2e5..01a0ace5 100644 --- a/ext/bg/js/search-query-parser.js +++ b/ext/bg/js/search-query-parser.js @@ -1,6 +1,5 @@ /* - * Copyright (C) 2019-2020 Alex Yatskov - * Author: Alex Yatskov + * Copyright (C) 2019-2020 Yomichan Authors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/ext/bg/js/search.js b/ext/bg/js/search.js index 9250fdde..2ba3e468 100644 --- a/ext/bg/js/search.js +++ b/ext/bg/js/search.js @@ -1,6 +1,5 @@ /* - * Copyright (C) 2016-2020 Alex Yatskov - * Author: Alex Yatskov + * Copyright (C) 2016-2020 Yomichan Authors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/ext/bg/js/settings/anki-templates.js b/ext/bg/js/settings/anki-templates.js index e3852eb4..d5b6e677 100644 --- a/ext/bg/js/settings/anki-templates.js +++ b/ext/bg/js/settings/anki-templates.js @@ -1,6 +1,5 @@ /* - * Copyright (C) 2019-2020 Alex Yatskov - * Author: Alex Yatskov + * Copyright (C) 2019-2020 Yomichan Authors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/ext/bg/js/settings/anki.js b/ext/bg/js/settings/anki.js index f2e1ca76..b32a9517 100644 --- a/ext/bg/js/settings/anki.js +++ b/ext/bg/js/settings/anki.js @@ -1,6 +1,5 @@ /* - * Copyright (C) 2019-2020 Alex Yatskov - * Author: Alex Yatskov + * Copyright (C) 2019-2020 Yomichan Authors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/ext/bg/js/settings/audio-ui.js b/ext/bg/js/settings/audio-ui.js index 206539a4..73c64227 100644 --- a/ext/bg/js/settings/audio-ui.js +++ b/ext/bg/js/settings/audio-ui.js @@ -1,6 +1,5 @@ /* - * Copyright (C) 2019-2020 Alex Yatskov - * Author: Alex Yatskov + * Copyright (C) 2019-2020 Yomichan Authors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/ext/bg/js/settings/audio.js b/ext/bg/js/settings/audio.js index 38dd6349..3c6e126c 100644 --- a/ext/bg/js/settings/audio.js +++ b/ext/bg/js/settings/audio.js @@ -1,6 +1,5 @@ /* - * Copyright (C) 2019-2020 Alex Yatskov - * Author: Alex Yatskov + * Copyright (C) 2019-2020 Yomichan Authors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/ext/bg/js/settings/backup.js b/ext/bg/js/settings/backup.js index 21417dfb..bdfef658 100644 --- a/ext/bg/js/settings/backup.js +++ b/ext/bg/js/settings/backup.js @@ -1,6 +1,5 @@ /* - * Copyright (C) 2019-2020 Alex Yatskov - * Author: Alex Yatskov + * Copyright (C) 2019-2020 Yomichan Authors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/ext/bg/js/settings/conditions-ui.js b/ext/bg/js/settings/conditions-ui.js index 9d61d25e..84498b42 100644 --- a/ext/bg/js/settings/conditions-ui.js +++ b/ext/bg/js/settings/conditions-ui.js @@ -1,6 +1,5 @@ /* - * Copyright (C) 2019-2020 Alex Yatskov - * Author: Alex Yatskov + * Copyright (C) 2019-2020 Yomichan Authors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/ext/bg/js/settings/dictionaries.js b/ext/bg/js/settings/dictionaries.js index 33ced3b9..1a6d452b 100644 --- a/ext/bg/js/settings/dictionaries.js +++ b/ext/bg/js/settings/dictionaries.js @@ -1,6 +1,5 @@ /* - * Copyright (C) 2019-2020 Alex Yatskov - * Author: Alex Yatskov + * Copyright (C) 2019-2020 Yomichan Authors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/ext/bg/js/settings/main.js b/ext/bg/js/settings/main.js index 1653ee35..8fd94562 100644 --- a/ext/bg/js/settings/main.js +++ b/ext/bg/js/settings/main.js @@ -1,6 +1,5 @@ /* - * Copyright (C) 2016-2020 Alex Yatskov - * Author: Alex Yatskov + * Copyright (C) 2016-2020 Yomichan Authors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/ext/bg/js/settings/popup-preview-frame.js b/ext/bg/js/settings/popup-preview-frame.js index 6a149841..fba114e2 100644 --- a/ext/bg/js/settings/popup-preview-frame.js +++ b/ext/bg/js/settings/popup-preview-frame.js @@ -1,6 +1,5 @@ /* - * Copyright (C) 2019-2020 Alex Yatskov - * Author: Alex Yatskov + * Copyright (C) 2019-2020 Yomichan Authors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/ext/bg/js/settings/popup-preview.js b/ext/bg/js/settings/popup-preview.js index d1d2ff5e..091872be 100644 --- a/ext/bg/js/settings/popup-preview.js +++ b/ext/bg/js/settings/popup-preview.js @@ -1,6 +1,5 @@ /* - * Copyright (C) 2019-2020 Alex Yatskov - * Author: Alex Yatskov + * Copyright (C) 2019-2020 Yomichan Authors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/ext/bg/js/settings/profiles.js b/ext/bg/js/settings/profiles.js index b35b6309..867b17aa 100644 --- a/ext/bg/js/settings/profiles.js +++ b/ext/bg/js/settings/profiles.js @@ -1,6 +1,5 @@ /* - * Copyright (C) 2019-2020 Alex Yatskov - * Author: Alex Yatskov + * Copyright (C) 2019-2020 Yomichan Authors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/ext/bg/js/settings/storage.js b/ext/bg/js/settings/storage.js index ae305e22..d754a109 100644 --- a/ext/bg/js/settings/storage.js +++ b/ext/bg/js/settings/storage.js @@ -1,6 +1,5 @@ /* - * Copyright (C) 2019-2020 Alex Yatskov - * Author: Alex Yatskov + * Copyright (C) 2019-2020 Yomichan Authors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/ext/bg/js/text-source-map.js b/ext/bg/js/text-source-map.js index 24970978..1776ae07 100644 --- a/ext/bg/js/text-source-map.js +++ b/ext/bg/js/text-source-map.js @@ -1,6 +1,5 @@ /* - * Copyright (C) 2020 Alex Yatskov - * Author: Alex Yatskov + * Copyright (C) 2020 Yomichan Authors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/ext/bg/js/translator.js b/ext/bg/js/translator.js index 27f91c05..e4441384 100644 --- a/ext/bg/js/translator.js +++ b/ext/bg/js/translator.js @@ -1,6 +1,5 @@ /* - * Copyright (C) 2016-2020 Alex Yatskov - * Author: Alex Yatskov + * Copyright (C) 2016-2020 Yomichan Authors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/ext/bg/js/util.js b/ext/bg/js/util.js index a7ed4a34..69536f02 100644 --- a/ext/bg/js/util.js +++ b/ext/bg/js/util.js @@ -1,6 +1,5 @@ /* - * Copyright (C) 2016-2020 Alex Yatskov - * Author: Alex Yatskov + * Copyright (C) 2016-2020 Yomichan Authors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/ext/bg/legal.html b/ext/bg/legal.html index c1e606d7..78acf79a 100644 --- a/ext/bg/legal.html +++ b/ext/bg/legal.html @@ -17,7 +17,7 @@

Yomichan License

-Copyright (C) 2016-2020  Alex Yatskov
+Copyright (C) 2016-2020  Yomichan Authors
 
 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
diff --git a/ext/fg/css/client.css b/ext/fg/css/client.css
index 5720d8ac..227f5030 100644
--- a/ext/fg/css/client.css
+++ b/ext/fg/css/client.css
@@ -1,6 +1,5 @@
 /*
- * Copyright (C) 2016-2020  Alex Yatskov 
- * Author: Alex Yatskov 
+ * Copyright (C) 2016-2020  Yomichan Authors
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
diff --git a/ext/fg/js/document.js b/ext/fg/js/document.js
index 490f61bb..3b4cc28f 100644
--- a/ext/fg/js/document.js
+++ b/ext/fg/js/document.js
@@ -1,6 +1,5 @@
 /*
- * Copyright (C) 2016-2020  Alex Yatskov 
- * Author: Alex Yatskov 
+ * Copyright (C) 2016-2020  Yomichan Authors
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
diff --git a/ext/fg/js/float.js b/ext/fg/js/float.js
index 01055ca6..77e5ea0a 100644
--- a/ext/fg/js/float.js
+++ b/ext/fg/js/float.js
@@ -1,6 +1,5 @@
 /*
- * Copyright (C) 2016-2020  Alex Yatskov 
- * Author: Alex Yatskov 
+ * Copyright (C) 2016-2020  Yomichan Authors
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
diff --git a/ext/fg/js/frame-offset-forwarder.js b/ext/fg/js/frame-offset-forwarder.js
index 7b417b6e..b3c10bb8 100644
--- a/ext/fg/js/frame-offset-forwarder.js
+++ b/ext/fg/js/frame-offset-forwarder.js
@@ -1,6 +1,5 @@
 /*
- * Copyright (C) 2020  Alex Yatskov 
- * Author: Alex Yatskov 
+ * Copyright (C) 2020  Yomichan Authors
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
diff --git a/ext/fg/js/frontend-api-receiver.js b/ext/fg/js/frontend-api-receiver.js
index 642d96df..4abd4e81 100644
--- a/ext/fg/js/frontend-api-receiver.js
+++ b/ext/fg/js/frontend-api-receiver.js
@@ -1,6 +1,5 @@
 /*
- * Copyright (C) 2019-2020  Alex Yatskov 
- * Author: Alex Yatskov 
+ * Copyright (C) 2019-2020  Yomichan Authors
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
diff --git a/ext/fg/js/frontend-api-sender.js b/ext/fg/js/frontend-api-sender.js
index 4431df61..1d539cab 100644
--- a/ext/fg/js/frontend-api-sender.js
+++ b/ext/fg/js/frontend-api-sender.js
@@ -1,6 +1,5 @@
 /*
- * Copyright (C) 2019-2020  Alex Yatskov 
- * Author: Alex Yatskov 
+ * Copyright (C) 2019-2020  Yomichan Authors
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
diff --git a/ext/fg/js/frontend-initialize.js b/ext/fg/js/frontend-initialize.js
index 4a1409db..0a586ff9 100644
--- a/ext/fg/js/frontend-initialize.js
+++ b/ext/fg/js/frontend-initialize.js
@@ -1,6 +1,5 @@
 /*
- * Copyright (C) 2019-2020  Alex Yatskov 
- * Author: Alex Yatskov 
+ * Copyright (C) 2019-2020  Yomichan Authors
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
diff --git a/ext/fg/js/frontend.js b/ext/fg/js/frontend.js
index 31843212..6fbbd0fb 100644
--- a/ext/fg/js/frontend.js
+++ b/ext/fg/js/frontend.js
@@ -1,6 +1,5 @@
 /*
- * Copyright (C) 2016-2020  Alex Yatskov 
- * Author: Alex Yatskov 
+ * Copyright (C) 2016-2020  Yomichan Authors
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
diff --git a/ext/fg/js/popup-nested.js b/ext/fg/js/popup-nested.js
index 39d91fd8..1b24614b 100644
--- a/ext/fg/js/popup-nested.js
+++ b/ext/fg/js/popup-nested.js
@@ -1,6 +1,5 @@
 /*
- * Copyright (C) 2019-2020  Alex Yatskov 
- * Author: Alex Yatskov 
+ * Copyright (C) 2019-2020  Yomichan Authors
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
diff --git a/ext/fg/js/popup-proxy-host.js b/ext/fg/js/popup-proxy-host.js
index 4b136e41..958462ff 100644
--- a/ext/fg/js/popup-proxy-host.js
+++ b/ext/fg/js/popup-proxy-host.js
@@ -1,6 +1,5 @@
 /*
- * Copyright (C) 2019-2020  Alex Yatskov 
- * Author: Alex Yatskov 
+ * Copyright (C) 2019-2020  Yomichan Authors
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
diff --git a/ext/fg/js/popup-proxy.js b/ext/fg/js/popup-proxy.js
index 966198a9..82ad9a8f 100644
--- a/ext/fg/js/popup-proxy.js
+++ b/ext/fg/js/popup-proxy.js
@@ -1,6 +1,5 @@
 /*
- * Copyright (C) 2019-2020  Alex Yatskov 
- * Author: Alex Yatskov 
+ * Copyright (C) 2019-2020  Yomichan Authors
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
diff --git a/ext/fg/js/popup.js b/ext/fg/js/popup.js
index 60dc16dd..42f08afa 100644
--- a/ext/fg/js/popup.js
+++ b/ext/fg/js/popup.js
@@ -1,6 +1,5 @@
 /*
- * Copyright (C) 2016-2020  Alex Yatskov 
- * Author: Alex Yatskov 
+ * Copyright (C) 2016-2020  Yomichan Authors
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
diff --git a/ext/fg/js/source.js b/ext/fg/js/source.js
index 6dc482bd..3d9afe0f 100644
--- a/ext/fg/js/source.js
+++ b/ext/fg/js/source.js
@@ -1,6 +1,5 @@
 /*
- * Copyright (C) 2016-2020  Alex Yatskov 
- * Author: Alex Yatskov 
+ * Copyright (C) 2016-2020  Yomichan Authors
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
diff --git a/ext/mixed/css/display-dark.css b/ext/mixed/css/display-dark.css
index 550dff3e..e4549bbf 100644
--- a/ext/mixed/css/display-dark.css
+++ b/ext/mixed/css/display-dark.css
@@ -1,6 +1,5 @@
 /*
- * Copyright (C) 2019-2020  Alex Yatskov 
- * Author: Alex Yatskov 
+ * Copyright (C) 2019-2020  Yomichan Authors
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the entrys of the GNU General Public License as published by
diff --git a/ext/mixed/css/display-default.css b/ext/mixed/css/display-default.css
index 487b8cb8..7bcb1014 100644
--- a/ext/mixed/css/display-default.css
+++ b/ext/mixed/css/display-default.css
@@ -1,6 +1,5 @@
 /*
- * Copyright (C) 2019-2020  Alex Yatskov 
- * Author: Alex Yatskov 
+ * Copyright (C) 2019-2020  Yomichan Authors
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the entrys of the GNU General Public License as published by
diff --git a/ext/mixed/css/display.css b/ext/mixed/css/display.css
index a4432016..92ba52c6 100644
--- a/ext/mixed/css/display.css
+++ b/ext/mixed/css/display.css
@@ -1,6 +1,5 @@
 /*
- * Copyright (C) 2016-2020  Alex Yatskov 
- * Author: Alex Yatskov 
+ * Copyright (C) 2016-2020  Yomichan Authors
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the entrys of the GNU General Public License as published by
diff --git a/ext/mixed/js/api.js b/ext/mixed/js/api.js
index feec94df..066077cf 100644
--- a/ext/mixed/js/api.js
+++ b/ext/mixed/js/api.js
@@ -1,6 +1,5 @@
 /*
- * Copyright (C) 2016-2020  Alex Yatskov 
- * Author: Alex Yatskov 
+ * Copyright (C) 2016-2020  Yomichan Authors
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
diff --git a/ext/mixed/js/audio-system.js b/ext/mixed/js/audio-system.js
index 31c476b1..45b733fc 100644
--- a/ext/mixed/js/audio-system.js
+++ b/ext/mixed/js/audio-system.js
@@ -1,6 +1,5 @@
 /*
- * Copyright (C) 2019-2020  Alex Yatskov 
- * Author: Alex Yatskov 
+ * Copyright (C) 2019-2020  Yomichan Authors
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
diff --git a/ext/mixed/js/core.js b/ext/mixed/js/core.js
index db7fc69b..2d11c11a 100644
--- a/ext/mixed/js/core.js
+++ b/ext/mixed/js/core.js
@@ -1,6 +1,5 @@
 /*
- * Copyright (C) 2019-2020  Alex Yatskov 
- * Author: Alex Yatskov 
+ * Copyright (C) 2019-2020  Yomichan Authors
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
diff --git a/ext/mixed/js/display-context.js b/ext/mixed/js/display-context.js
index c11c2342..5ee78459 100644
--- a/ext/mixed/js/display-context.js
+++ b/ext/mixed/js/display-context.js
@@ -1,6 +1,5 @@
 /*
- * Copyright (C) 2019-2020  Alex Yatskov 
- * Author: Alex Yatskov 
+ * Copyright (C) 2019-2020  Yomichan Authors
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
diff --git a/ext/mixed/js/display-generator.js b/ext/mixed/js/display-generator.js
index f1122e3d..b0cc2478 100644
--- a/ext/mixed/js/display-generator.js
+++ b/ext/mixed/js/display-generator.js
@@ -1,6 +1,5 @@
 /*
- * Copyright (C) 2019-2020  Alex Yatskov 
- * Author: Alex Yatskov 
+ * Copyright (C) 2019-2020  Yomichan Authors
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
diff --git a/ext/mixed/js/display.js b/ext/mixed/js/display.js
index 2f456c3e..bf6990a1 100644
--- a/ext/mixed/js/display.js
+++ b/ext/mixed/js/display.js
@@ -1,6 +1,5 @@
 /*
- * Copyright (C) 2017-2020  Alex Yatskov 
- * Author: Alex Yatskov 
+ * Copyright (C) 2017-2020  Yomichan Authors
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
diff --git a/ext/mixed/js/dom.js b/ext/mixed/js/dom.js
index 807a48e1..03acbb80 100644
--- a/ext/mixed/js/dom.js
+++ b/ext/mixed/js/dom.js
@@ -1,6 +1,5 @@
 /*
- * Copyright (C) 2019-2020  Alex Yatskov 
- * Author: Alex Yatskov 
+ * Copyright (C) 2019-2020  Yomichan Authors
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
diff --git a/ext/mixed/js/japanese.js b/ext/mixed/js/japanese.js
index e6b9a8a0..79d69946 100644
--- a/ext/mixed/js/japanese.js
+++ b/ext/mixed/js/japanese.js
@@ -1,6 +1,5 @@
 /*
- * Copyright (C) 2020  Alex Yatskov 
- * Author: Alex Yatskov 
+ * Copyright (C) 2020  Yomichan Authors
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
diff --git a/ext/mixed/js/object-property-accessor.js b/ext/mixed/js/object-property-accessor.js
index 108afc0d..349037b3 100644
--- a/ext/mixed/js/object-property-accessor.js
+++ b/ext/mixed/js/object-property-accessor.js
@@ -1,6 +1,5 @@
 /*
- * Copyright (C) 2016-2020  Alex Yatskov 
- * Author: Alex Yatskov 
+ * Copyright (C) 2016-2020  Yomichan Authors
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
diff --git a/ext/mixed/js/scroll.js b/ext/mixed/js/scroll.js
index 72da8b65..840fdb9c 100644
--- a/ext/mixed/js/scroll.js
+++ b/ext/mixed/js/scroll.js
@@ -1,6 +1,5 @@
 /*
- * Copyright (C) 2019-2020  Alex Yatskov 
- * Author: Alex Yatskov 
+ * Copyright (C) 2019-2020  Yomichan Authors
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
diff --git a/ext/mixed/js/template-handler.js b/ext/mixed/js/template-handler.js
index a5a62937..f17fd60c 100644
--- a/ext/mixed/js/template-handler.js
+++ b/ext/mixed/js/template-handler.js
@@ -1,6 +1,5 @@
 /*
- * Copyright (C) 2020  Alex Yatskov 
- * Author: Alex Yatskov 
+ * Copyright (C) 2020  Yomichan Authors
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
diff --git a/ext/mixed/js/text-scanner.js b/ext/mixed/js/text-scanner.js
index b8156c01..a1d96320 100644
--- a/ext/mixed/js/text-scanner.js
+++ b/ext/mixed/js/text-scanner.js
@@ -1,6 +1,5 @@
 /*
- * Copyright (C) 2019-2020  Alex Yatskov 
- * Author: Alex Yatskov 
+ * Copyright (C) 2019-2020  Yomichan Authors
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
diff --git a/ext/mixed/js/timer.js b/ext/mixed/js/timer.js
index 1caf7a05..30408e93 100644
--- a/ext/mixed/js/timer.js
+++ b/ext/mixed/js/timer.js
@@ -1,6 +1,5 @@
 /*
- * Copyright (C) 2019-2020  Alex Yatskov 
- * Author: Alex Yatskov 
+ * Copyright (C) 2019-2020  Yomichan Authors
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
diff --git a/test/dictionary-validate.js b/test/dictionary-validate.js
index 6496f2ac..f1730852 100644
--- a/test/dictionary-validate.js
+++ b/test/dictionary-validate.js
@@ -1,6 +1,5 @@
 /*
- * Copyright (C) 2020  Alex Yatskov 
- * Author: Alex Yatskov 
+ * Copyright (C) 2020  Yomichan Authors
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
diff --git a/test/lint/global-declarations.js b/test/lint/global-declarations.js
index 2629cc5e..07ba5570 100644
--- a/test/lint/global-declarations.js
+++ b/test/lint/global-declarations.js
@@ -1,6 +1,6 @@
 /*
- * Copyright (C) 2020  Alex Yatskov 
- * Author: Alex Yatskov 
+ * Copyright (C) 2020  Yomichan Authors
+ * Author: Yomichan Authors
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
diff --git a/test/schema-validate.js b/test/schema-validate.js
index eb31aa8d..761f0a1c 100644
--- a/test/schema-validate.js
+++ b/test/schema-validate.js
@@ -1,6 +1,5 @@
 /*
- * Copyright (C) 2020  Alex Yatskov 
- * Author: Alex Yatskov 
+ * Copyright (C) 2020  Yomichan Authors
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
diff --git a/test/test-database.js b/test/test-database.js
index bab15aa4..d27f92e1 100644
--- a/test/test-database.js
+++ b/test/test-database.js
@@ -1,6 +1,5 @@
 /*
- * Copyright (C) 2020  Alex Yatskov 
- * Author: Alex Yatskov 
+ * Copyright (C) 2020  Yomichan Authors
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
diff --git a/test/test-dictionary.js b/test/test-dictionary.js
index 74f9e62b..27cc90df 100644
--- a/test/test-dictionary.js
+++ b/test/test-dictionary.js
@@ -1,6 +1,5 @@
 /*
- * Copyright (C) 2020  Alex Yatskov 
- * Author: Alex Yatskov 
+ * Copyright (C) 2020  Yomichan Authors
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
diff --git a/test/test-document.js b/test/test-document.js
index 80b9719d..0d9026db 100644
--- a/test/test-document.js
+++ b/test/test-document.js
@@ -1,6 +1,5 @@
 /*
- * Copyright (C) 2020  Alex Yatskov 
- * Author: Alex Yatskov 
+ * Copyright (C) 2020  Yomichan Authors
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
diff --git a/test/test-japanese.js b/test/test-japanese.js
index ca65dde2..f4b084ac 100644
--- a/test/test-japanese.js
+++ b/test/test-japanese.js
@@ -1,6 +1,5 @@
 /*
- * Copyright (C) 2020  Alex Yatskov 
- * Author: Alex Yatskov 
+ * Copyright (C) 2020  Yomichan Authors
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
diff --git a/test/test-object-property-accessor.js b/test/test-object-property-accessor.js
index 47d2e451..0773ba6e 100644
--- a/test/test-object-property-accessor.js
+++ b/test/test-object-property-accessor.js
@@ -1,6 +1,5 @@
 /*
- * Copyright (C) 2020  Alex Yatskov 
- * Author: Alex Yatskov 
+ * Copyright (C) 2020  Yomichan Authors
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
diff --git a/test/test-schema.js b/test/test-schema.js
index 5f9915fd..7620ab16 100644
--- a/test/test-schema.js
+++ b/test/test-schema.js
@@ -1,6 +1,5 @@
 /*
- * Copyright (C) 2020  Alex Yatskov 
- * Author: Alex Yatskov 
+ * Copyright (C) 2020  Yomichan Authors
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
diff --git a/test/test-text-source-map.js b/test/test-text-source-map.js
index 25bd8fc2..f092de2c 100644
--- a/test/test-text-source-map.js
+++ b/test/test-text-source-map.js
@@ -1,6 +1,5 @@
 /*
- * Copyright (C) 2020  Alex Yatskov 
- * Author: Alex Yatskov 
+ * Copyright (C) 2020  Yomichan Authors
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
diff --git a/test/yomichan-test.js b/test/yomichan-test.js
index 5fa7730b..3351ecdf 100644
--- a/test/yomichan-test.js
+++ b/test/yomichan-test.js
@@ -1,6 +1,5 @@
 /*
- * Copyright (C) 2020  Alex Yatskov 
- * Author: Alex Yatskov 
+ * Copyright (C) 2020  Yomichan Authors
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
diff --git a/test/yomichan-vm.js b/test/yomichan-vm.js
index ff478844..97faa03e 100644
--- a/test/yomichan-vm.js
+++ b/test/yomichan-vm.js
@@ -1,6 +1,5 @@
 /*
- * Copyright (C) 2020  Alex Yatskov 
- * Author: Alex Yatskov 
+ * Copyright (C) 2020  Yomichan Authors
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
-- 
cgit v1.2.3


From d164fc6f6255ecbfc9c120f52af7983e46ed4c51 Mon Sep 17 00:00:00 2001
From: toasted-nutbread 
Date: Fri, 10 Apr 2020 18:45:23 -0400
Subject: Remove unused globals

---
 ext/bg/js/backend.js  | 1 -
 ext/bg/js/database.js | 3 ---
 2 files changed, 4 deletions(-)

(limited to 'ext/bg/js/backend.js')

diff --git a/ext/bg/js/backend.js b/ext/bg/js/backend.js
index 6386319b..4a36be57 100644
--- a/ext/bg/js/backend.js
+++ b/ext/bg/js/backend.js
@@ -30,7 +30,6 @@
  * Translator
  * conditionsTestValue
  * dictConfigured
- * dictEnabledSet
  * dictTermsSort
  * handlebarsRenderDynamic
  * jp
diff --git a/ext/bg/js/database.js b/ext/bg/js/database.js
index ad4e3bad..260c815a 100644
--- a/ext/bg/js/database.js
+++ b/ext/bg/js/database.js
@@ -16,10 +16,7 @@
  */
 
 /* global
- * JSZip
- * JsonSchema
  * dictFieldSplit
- * requestJson
  */
 
 class Database {
-- 
cgit v1.2.3


From a296c758b95b428777548f5aada1be13429faf03 Mon Sep 17 00:00:00 2001
From: toasted-nutbread 
Date: Fri, 10 Apr 2020 20:00:18 -0400
Subject: apiBroadcast => apiBroadcastTab

---
 ext/bg/js/backend.js                | 4 ++--
 ext/fg/js/float.js                  | 6 +++---
 ext/fg/js/frame-offset-forwarder.js | 4 ++--
 ext/fg/js/frontend-initialize.js    | 4 ++--
 ext/fg/js/frontend.js               | 6 +++---
 ext/mixed/js/api.js                 | 4 ++--
 ext/mixed/js/display.js             | 4 ++--
 7 files changed, 16 insertions(+), 16 deletions(-)

(limited to 'ext/bg/js/backend.js')

diff --git a/ext/bg/js/backend.js b/ext/bg/js/backend.js
index 35e75bbe..20e17836 100644
--- a/ext/bg/js/backend.js
+++ b/ext/bg/js/backend.js
@@ -94,7 +94,7 @@ class Backend {
             ['commandExec', {handler: this._onApiCommandExec.bind(this), async: false}],
             ['audioGetUri', {handler: this._onApiAudioGetUri.bind(this), async: true}],
             ['screenshotGet', {handler: this._onApiScreenshotGet.bind(this), async: true}],
-            ['broadcast', {handler: this._onApiBroadcast.bind(this), async: false}],
+            ['broadcastTab', {handler: this._onApiBroadcastTab.bind(this), async: false}],
             ['frameInformationGet', {handler: this._onApiFrameInformationGet.bind(this), async: true}],
             ['injectStylesheet', {handler: this._onApiInjectStylesheet.bind(this), async: true}],
             ['getEnvironmentInfo', {handler: this._onApiGetEnvironmentInfo.bind(this), async: true}],
@@ -566,7 +566,7 @@ class Backend {
         });
     }
 
-    _onApiBroadcast({action, params}, sender) {
+    _onApiBroadcastTab({action, params}, sender) {
         if (!(sender && sender.tab)) {
             return false;
         }
diff --git a/ext/fg/js/float.js b/ext/fg/js/float.js
index 8c00d0a5..d0c0f419 100644
--- a/ext/fg/js/float.js
+++ b/ext/fg/js/float.js
@@ -18,7 +18,7 @@
 
 /* global
  * Display
- * apiBroadcast
+ * apiBroadcastTab
  * apiGetMessageToken
  * popupNestedInitialize
  */
@@ -80,7 +80,7 @@ class DisplayFloat extends Display {
 
         this.setContentScale(scale);
 
-        apiBroadcast('popupPrepareCompleted', {targetPopupId: this._popupId});
+        apiBroadcastTab('popupPrepareCompleted', {targetPopupId: this._popupId});
     }
 
     onError(error) {
@@ -181,7 +181,7 @@ class DisplayFloat extends Display {
                 },
                 2000
             );
-            apiBroadcast('requestDocumentInformationBroadcast', {uniqueId});
+            apiBroadcastTab('requestDocumentInformationBroadcast', {uniqueId});
 
             const {title} = await promise;
             return title;
diff --git a/ext/fg/js/frame-offset-forwarder.js b/ext/fg/js/frame-offset-forwarder.js
index 88c1b72c..609d0d77 100644
--- a/ext/fg/js/frame-offset-forwarder.js
+++ b/ext/fg/js/frame-offset-forwarder.js
@@ -17,7 +17,7 @@
  */
 
 /* global
- * apiBroadcast
+ * apiBroadcastTab
  */
 
 class FrameOffsetForwarder {
@@ -97,6 +97,6 @@ class FrameOffsetForwarder {
     }
 
     _forwardFrameOffsetOrigin(offset, uniqueId) {
-        apiBroadcast('frameOffset', {offset, uniqueId});
+        apiBroadcastTab('frameOffset', {offset, uniqueId});
     }
 }
diff --git a/ext/fg/js/frontend-initialize.js b/ext/fg/js/frontend-initialize.js
index d2572746..5c9ce7b1 100644
--- a/ext/fg/js/frontend-initialize.js
+++ b/ext/fg/js/frontend-initialize.js
@@ -21,7 +21,7 @@
  * Frontend
  * PopupProxy
  * PopupProxyHost
- * apiBroadcast
+ * apiBroadcastTab
  * apiOptionsGet
  */
 
@@ -44,7 +44,7 @@ async function main() {
                 }
             }
         );
-        apiBroadcast('rootPopupRequestInformationBroadcast');
+        apiBroadcastTab('rootPopupRequestInformationBroadcast');
         const {popupId, frameId} = await rootPopupInformationPromise;
 
         const frameOffsetForwarder = new FrameOffsetForwarder();
diff --git a/ext/fg/js/frontend.js b/ext/fg/js/frontend.js
index bcb0b84a..b380dbfd 100644
--- a/ext/fg/js/frontend.js
+++ b/ext/fg/js/frontend.js
@@ -18,7 +18,7 @@
 
 /* global
  * TextScanner
- * apiBroadcast
+ * apiBroadcastTab
  * apiGetZoom
  * apiKanjiFind
  * apiOptionsGet
@@ -261,12 +261,12 @@ class Frontend extends TextScanner {
 
     _broadcastRootPopupInformation() {
         if (!this.popup.isProxy() && this.popup.depth === 0) {
-            apiBroadcast('rootPopupInformation', {popupId: this.popup.id, frameId: this.popup.frameId});
+            apiBroadcastTab('rootPopupInformation', {popupId: this.popup.id, frameId: this.popup.frameId});
         }
     }
 
     _broadcastDocumentInformation(uniqueId) {
-        apiBroadcast('documentInformationBroadcast', {
+        apiBroadcastTab('documentInformationBroadcast', {
             uniqueId,
             frameId: this.popup.frameId,
             title: document.title
diff --git a/ext/mixed/js/api.js b/ext/mixed/js/api.js
index d28e3ab6..83a4a403 100644
--- a/ext/mixed/js/api.js
+++ b/ext/mixed/js/api.js
@@ -81,8 +81,8 @@ function apiScreenshotGet(options) {
     return _apiInvoke('screenshotGet', {options});
 }
 
-function apiBroadcast(action, params) {
-    return _apiInvoke('broadcast', {action, params});
+function apiBroadcastTab(action, params) {
+    return _apiInvoke('broadcastTab', {action, params});
 }
 
 function apiFrameInformationGet() {
diff --git a/ext/mixed/js/display.js b/ext/mixed/js/display.js
index 710674b2..b691ae12 100644
--- a/ext/mixed/js/display.js
+++ b/ext/mixed/js/display.js
@@ -23,7 +23,7 @@
  * DisplayGenerator
  * WindowScroll
  * apiAudioGetUri
- * apiBroadcast
+ * apiBroadcastTab
  * apiDefinitionAdd
  * apiDefinitionsAddable
  * apiKanjiFind
@@ -855,7 +855,7 @@ class Display {
     }
 
     setPopupVisibleOverride(visible) {
-        return apiBroadcast('popupSetVisibleOverride', {visible});
+        return apiBroadcastTab('popupSetVisibleOverride', {visible});
     }
 
     setSpinnerVisible(visible) {
-- 
cgit v1.2.3


From c613321a735dbf333491ab199b808f30852a8daa Mon Sep 17 00:00:00 2001
From: siikamiika 
Date: Sun, 12 Apr 2020 03:53:24 +0300
Subject: move QueryParser.parseText to Backend

---
 ext/bg/js/backend.js                       | 128 +++++++++++++++++------------
 ext/bg/js/search-query-parser-generator.js |  11 ++-
 ext/bg/js/search-query-parser.js           |  27 +-----
 ext/mixed/js/api.js                        |   4 -
 4 files changed, 88 insertions(+), 82 deletions(-)

(limited to 'ext/bg/js/backend.js')

diff --git a/ext/bg/js/backend.js b/ext/bg/js/backend.js
index be8ea322..65e00f28 100644
--- a/ext/bg/js/backend.js
+++ b/ext/bg/js/backend.js
@@ -85,7 +85,6 @@ class Backend {
             ['kanjiFind', {handler: this._onApiKanjiFind.bind(this), async: true}],
             ['termsFind', {handler: this._onApiTermsFind.bind(this), async: true}],
             ['textParse', {handler: this._onApiTextParse.bind(this), async: true}],
-            ['textParseMecab', {handler: this._onApiTextParseMecab.bind(this), async: true}],
             ['definitionAdd', {handler: this._onApiDefinitionAdd.bind(this), async: true}],
             ['definitionsAddable', {handler: this._onApiDefinitionsAddable.bind(this), async: true}],
             ['noteView', {handler: this._onApiNoteView.bind(this), async: true}],
@@ -315,6 +314,65 @@ class Backend {
         return await this.dictionaryImporter.import(this.database, archiveSource, onProgress, details);
     }
 
+    async _textParseScanning(text, options) {
+        const results = [];
+        while (text.length > 0) {
+            const term = [];
+            const [definitions, sourceLength] = await this.translator.findTerms(
+                'simple',
+                text.substring(0, options.scanning.length),
+                {},
+                options
+            );
+            if (definitions.length > 0) {
+                dictTermsSort(definitions);
+                const {expression, reading} = definitions[0];
+                const source = text.substring(0, sourceLength);
+                for (const {text: text2, furigana} of jp.distributeFuriganaInflected(expression, reading, source)) {
+                    const reading2 = jp.convertReading(text2, furigana, options.parsing.readingMode);
+                    term.push({text: text2, reading: reading2});
+                }
+                text = text.substring(source.length);
+            } else {
+                const reading = jp.convertReading(text[0], null, options.parsing.readingMode);
+                term.push({text: text[0], reading});
+                text = text.substring(1);
+            }
+            results.push(term);
+        }
+        return results;
+    }
+
+    async _textParseMecab(text, options) {
+        const results = [];
+        const rawResults = await this.mecab.parseText(text);
+        for (const [mecabName, parsedLines] of Object.entries(rawResults)) {
+            const result = [];
+            for (const parsedLine of parsedLines) {
+                for (const {expression, reading, source} of parsedLine) {
+                    const term = [];
+                    if (expression !== null && reading !== null) {
+                        for (const {text: text2, furigana} of jp.distributeFuriganaInflected(
+                            expression,
+                            jp.convertKatakanaToHiragana(reading),
+                            source
+                        )) {
+                            const reading2 = jp.convertReading(text2, furigana, options.parsing.readingMode);
+                            term.push({text: text2, reading: reading2});
+                        }
+                    } else {
+                        const reading2 = jp.convertReading(source, null, options.parsing.readingMode);
+                        term.push({text: source, reading: reading2});
+                    }
+                    result.push(term);
+                }
+                result.push([{text: '\n'}]);
+            }
+            results.push([mecabName, result]);
+        }
+        return results;
+    }
+
     // Message handlers
 
     _onApiYomichanCoreReady(_params, sender) {
@@ -406,61 +464,27 @@ class Backend {
     async _onApiTextParse({text, optionsContext}) {
         const options = this.getOptions(optionsContext);
         const results = [];
-        while (text.length > 0) {
-            const term = [];
-            const [definitions, sourceLength] = await this.translator.findTerms(
-                'simple',
-                text.substring(0, options.scanning.length),
-                {},
-                options
-            );
-            if (definitions.length > 0) {
-                dictTermsSort(definitions);
-                const {expression, reading} = definitions[0];
-                const source = text.substring(0, sourceLength);
-                for (const {text: text2, furigana} of jp.distributeFuriganaInflected(expression, reading, source)) {
-                    const reading2 = jp.convertReading(text2, furigana, options.parsing.readingMode);
-                    term.push({text: text2, reading: reading2});
-                }
-                text = text.substring(source.length);
-            } else {
-                const reading = jp.convertReading(text[0], null, options.parsing.readingMode);
-                term.push({text: text[0], reading});
-                text = text.substring(1);
-            }
-            results.push(term);
+
+        if (options.parsing.enableScanningParser) {
+            results.push({
+                source: 'scanning-parser',
+                id: 'scan',
+                content: await this._textParseScanning(text, options)
+            });
         }
-        return results;
-    }
 
-    async _onApiTextParseMecab({text, optionsContext}) {
-        const options = this.getOptions(optionsContext);
-        const results = [];
-        const rawResults = await this.mecab.parseText(text);
-        for (const [mecabName, parsedLines] of Object.entries(rawResults)) {
-            const result = [];
-            for (const parsedLine of parsedLines) {
-                for (const {expression, reading, source} of parsedLine) {
-                    const term = [];
-                    if (expression !== null && reading !== null) {
-                        for (const {text: text2, furigana} of jp.distributeFuriganaInflected(
-                            expression,
-                            jp.convertKatakanaToHiragana(reading),
-                            source
-                        )) {
-                            const reading2 = jp.convertReading(text2, furigana, options.parsing.readingMode);
-                            term.push({text: text2, reading: reading2});
-                        }
-                    } else {
-                        const reading2 = jp.convertReading(source, null, options.parsing.readingMode);
-                        term.push({text: source, reading: reading2});
-                    }
-                    result.push(term);
-                }
-                result.push([{text: '\n'}]);
+        if (options.parsing.enableMecabParser) {
+            const mecabResults = await this._textParseMecab(text, options);
+            for (const [mecabDictName, mecabDictResults] of mecabResults) {
+                results.push({
+                    source: 'mecab',
+                    dictionary: mecabDictName,
+                    id: `mecab-${mecabDictName}`,
+                    content: mecabDictResults
+                });
             }
-            results.push([mecabName, result]);
         }
+
         return results;
     }
 
diff --git a/ext/bg/js/search-query-parser-generator.js b/ext/bg/js/search-query-parser-generator.js
index 390841c1..d44829f7 100644
--- a/ext/bg/js/search-query-parser-generator.js
+++ b/ext/bg/js/search-query-parser-generator.js
@@ -71,7 +71,16 @@ class QueryParserGenerator {
         for (const parseResult of parseResults) {
             const optionContainer = this._templateHandler.instantiate('select-option');
             optionContainer.value = parseResult.id;
-            optionContainer.textContent = parseResult.name;
+            switch (parseResult.source) {
+                case 'scanning-parser':
+                    optionContainer.textContent = 'Scanning parser';
+                    break;
+                case 'mecab':
+                    optionContainer.textContent = `MeCab: ${parseResult.dictionary}`;
+                    break;
+                default:
+                    optionContainer.textContent = 'Unrecognized dictionary';
+            }
             optionContainer.defaultSelected = selectedParser === parseResult.id;
             selectContainer.appendChild(optionContainer);
         }
diff --git a/ext/bg/js/search-query-parser.js b/ext/bg/js/search-query-parser.js
index 01a0ace5..da61b045 100644
--- a/ext/bg/js/search-query-parser.js
+++ b/ext/bg/js/search-query-parser.js
@@ -21,7 +21,6 @@
  * apiOptionsSet
  * apiTermsFind
  * apiTextParse
- * apiTextParseMecab
  * docSentenceExtract
  */
 
@@ -128,7 +127,7 @@ class QueryParser extends TextScanner {
 
         this.setPreview(text);
 
-        this.parseResults = await this.parseText(text);
+        this.parseResults = await apiTextParse(text, this.getOptionsContext());
         this.refreshSelectedParser();
 
         this.renderParserSelect();
@@ -137,28 +136,6 @@ class QueryParser extends TextScanner {
         this.setSpinnerVisible(false);
     }
 
-    async parseText(text) {
-        const results = [];
-        if (this.options.parsing.enableScanningParser) {
-            results.push({
-                name: 'Scanning parser',
-                id: 'scan',
-                parsedText: await apiTextParse(text, this.getOptionsContext())
-            });
-        }
-        if (this.options.parsing.enableMecabParser) {
-            const mecabResults = await apiTextParseMecab(text, this.getOptionsContext());
-            for (const [mecabDictName, mecabDictResults] of mecabResults) {
-                results.push({
-                    name: `MeCab: ${mecabDictName}`,
-                    id: `mecab-${mecabDictName}`,
-                    parsedText: mecabDictResults
-                });
-            }
-        }
-        return results;
-    }
-
     setPreview(text) {
         const previewTerms = [];
         for (let i = 0, ii = text.length; i < ii; i += 2) {
@@ -183,6 +160,6 @@ class QueryParser extends TextScanner {
         const parseResult = this.getParseResult();
         this.queryParser.textContent = '';
         if (!parseResult) { return; }
-        this.queryParser.appendChild(this.queryParserGenerator.createParseResult(parseResult.parsedText));
+        this.queryParser.appendChild(this.queryParserGenerator.createParseResult(parseResult.content));
     }
 }
diff --git a/ext/mixed/js/api.js b/ext/mixed/js/api.js
index 50b285a5..30c08347 100644
--- a/ext/mixed/js/api.js
+++ b/ext/mixed/js/api.js
@@ -44,10 +44,6 @@ function apiTextParse(text, optionsContext) {
     return _apiInvoke('textParse', {text, optionsContext});
 }
 
-function apiTextParseMecab(text, optionsContext) {
-    return _apiInvoke('textParseMecab', {text, optionsContext});
-}
-
 function apiKanjiFind(text, optionsContext) {
     return _apiInvoke('kanjiFind', {text, optionsContext});
 }
-- 
cgit v1.2.3


From f93dc857107e9b23ec06f1b568aad2c6f870ba4c Mon Sep 17 00:00:00 2001
From: siikamiika 
Date: Mon, 13 Apr 2020 22:55:33 +0300
Subject: assume and propagate strings for text parsing

---
 ext/bg/js/backend.js                       | 26 ++++++-------
 ext/bg/js/japanese.js                      | 10 ++---
 ext/bg/js/search-query-parser-generator.js |  2 +-
 ext/bg/js/search-query-parser.js           |  2 +-
 test/test-japanese.js                      | 60 +++++++++---------------------
 5 files changed, 36 insertions(+), 64 deletions(-)

(limited to 'ext/bg/js/backend.js')

diff --git a/ext/bg/js/backend.js b/ext/bg/js/backend.js
index 65e00f28..d5086af2 100644
--- a/ext/bg/js/backend.js
+++ b/ext/bg/js/backend.js
@@ -334,7 +334,7 @@ class Backend {
                 }
                 text = text.substring(source.length);
             } else {
-                const reading = jp.convertReading(text[0], null, options.parsing.readingMode);
+                const reading = jp.convertReading(text[0], '', options.parsing.readingMode);
                 term.push({text: text[0], reading});
                 text = text.substring(1);
             }
@@ -349,24 +349,20 @@ class Backend {
         for (const [mecabName, parsedLines] of Object.entries(rawResults)) {
             const result = [];
             for (const parsedLine of parsedLines) {
-                for (const {expression, reading, source} of parsedLine) {
+                for (let {expression, reading, source} of parsedLine) {
                     const term = [];
-                    if (expression !== null && reading !== null) {
-                        for (const {text: text2, furigana} of jp.distributeFuriganaInflected(
-                            expression,
-                            jp.convertKatakanaToHiragana(reading),
-                            source
-                        )) {
-                            const reading2 = jp.convertReading(text2, furigana, options.parsing.readingMode);
-                            term.push({text: text2, reading: reading2});
-                        }
-                    } else {
-                        const reading2 = jp.convertReading(source, null, options.parsing.readingMode);
-                        term.push({text: source, reading: reading2});
+                    if (expression === '') { expression = source; }
+                    for (const {text: text2, furigana} of jp.distributeFuriganaInflected(
+                        expression,
+                        jp.convertKatakanaToHiragana(reading),
+                        source
+                    )) {
+                        const reading2 = jp.convertReading(text2, furigana, options.parsing.readingMode);
+                        term.push({text: text2, reading: reading2});
                     }
                     result.push(term);
                 }
-                result.push([{text: '\n'}]);
+                result.push([{text: '\n', reading: ''}]);
             }
             results.push([mecabName, result]);
         }
diff --git a/ext/bg/js/japanese.js b/ext/bg/js/japanese.js
index 5fef27a7..c74e4553 100644
--- a/ext/bg/js/japanese.js
+++ b/ext/bg/js/japanese.js
@@ -127,9 +127,9 @@
     function convertReading(expressionFragment, readingFragment, readingMode) {
         switch (readingMode) {
             case 'hiragana':
-                return convertKatakanaToHiragana(readingFragment || '');
+                return convertKatakanaToHiragana(readingFragment);
             case 'katakana':
-                return convertHiraganaToKatakana(readingFragment || '');
+                return convertHiraganaToKatakana(readingFragment);
             case 'romaji':
                 if (readingFragment) {
                     return convertToRomaji(readingFragment);
@@ -140,7 +140,7 @@
                 }
                 return readingFragment;
             case 'none':
-                return null;
+                return '';
             default:
                 return readingFragment;
         }
@@ -300,7 +300,7 @@
                     const readingLeft = reading2.substring(group.text.length);
                     const segs = segmentize(readingLeft, groups.splice(1));
                     if (segs) {
-                        return [{text: group.text}].concat(segs);
+                        return [{text: group.text, furigana: ''}].concat(segs);
                     }
                 }
             } else {
@@ -368,7 +368,7 @@
         }
 
         if (stemLength !== source.length) {
-            output.push({text: source.substring(stemLength)});
+            output.push({text: source.substring(stemLength), furigana: ''});
         }
 
         return output;
diff --git a/ext/bg/js/search-query-parser-generator.js b/ext/bg/js/search-query-parser-generator.js
index d44829f7..527302ed 100644
--- a/ext/bg/js/search-query-parser-generator.js
+++ b/ext/bg/js/search-query-parser-generator.js
@@ -36,7 +36,7 @@ class QueryParserGenerator {
             const termContainer = this._templateHandler.instantiate(preview ? 'term-preview' : 'term');
             for (const segment of term) {
                 if (!segment.text.trim()) { continue; }
-                if (!segment.reading || !segment.reading.trim()) {
+                if (!segment.reading.trim()) {
                     termContainer.appendChild(this.createSegmentText(segment.text));
                 } else {
                     termContainer.appendChild(this.createSegment(segment));
diff --git a/ext/bg/js/search-query-parser.js b/ext/bg/js/search-query-parser.js
index da61b045..692fb1a8 100644
--- a/ext/bg/js/search-query-parser.js
+++ b/ext/bg/js/search-query-parser.js
@@ -140,7 +140,7 @@ class QueryParser extends TextScanner {
         const previewTerms = [];
         for (let i = 0, ii = text.length; i < ii; i += 2) {
             const tempText = text.substring(i, i + 2);
-            previewTerms.push([{text: tempText}]);
+            previewTerms.push([{text: tempText, reading: ''}]);
         }
         this.queryParser.textContent = '';
         this.queryParser.appendChild(this.queryParserGenerator.createParseResult(previewTerms, true));
diff --git a/test/test-japanese.js b/test/test-japanese.js
index 89e41c36..7fd71ba8 100644
--- a/test/test-japanese.js
+++ b/test/test-japanese.js
@@ -176,19 +176,19 @@ function testConvertReading() {
         [['アリガトウ', 'アリガトウ', 'hiragana'], 'ありがとう'],
         [['アリガトウ', 'アリガトウ', 'katakana'], 'アリガトウ'],
         [['アリガトウ', 'アリガトウ', 'romaji'], 'arigatou'],
-        [['アリガトウ', 'アリガトウ', 'none'], null],
+        [['アリガトウ', 'アリガトウ', 'none'], ''],
         [['アリガトウ', 'アリガトウ', 'default'], 'アリガトウ'],
 
         [['ありがとう', 'ありがとう', 'hiragana'], 'ありがとう'],
         [['ありがとう', 'ありがとう', 'katakana'], 'アリガトウ'],
         [['ありがとう', 'ありがとう', 'romaji'], 'arigatou'],
-        [['ありがとう', 'ありがとう', 'none'], null],
+        [['ありがとう', 'ありがとう', 'none'], ''],
         [['ありがとう', 'ありがとう', 'default'], 'ありがとう'],
 
         [['有り難う', 'ありがとう', 'hiragana'], 'ありがとう'],
         [['有り難う', 'ありがとう', 'katakana'], 'アリガトウ'],
         [['有り難う', 'ありがとう', 'romaji'], 'arigatou'],
-        [['有り難う', 'ありがとう', 'none'], null],
+        [['有り難う', 'ありがとう', 'none'], ''],
         [['有り難う', 'ありがとう', 'default'], 'ありがとう'],
 
         // Cases with falsy readings
@@ -196,40 +196,16 @@ function testConvertReading() {
         [['ありがとう', '', 'hiragana'], ''],
         [['ありがとう', '', 'katakana'], ''],
         [['ありがとう', '', 'romaji'], 'arigatou'],
-        [['ありがとう', '', 'none'], null],
+        [['ありがとう', '', 'none'], ''],
         [['ありがとう', '', 'default'], ''],
 
-        [['ありがとう', null, 'hiragana'], ''],
-        [['ありがとう', null, 'katakana'], ''],
-        [['ありがとう', null, 'romaji'], 'arigatou'],
-        [['ありがとう', null, 'none'], null],
-        [['ありがとう', null, 'default'], null],
-
-        [['ありがとう', void 0, 'hiragana'], ''],
-        [['ありがとう', void 0, 'katakana'], ''],
-        [['ありがとう', void 0, 'romaji'], 'arigatou'],
-        [['ありがとう', void 0, 'none'], null],
-        [['ありがとう', void 0, 'default'], void 0],
-
         // Cases with falsy readings and kanji expressions
 
         [['有り難う', '', 'hiragana'], ''],
         [['有り難う', '', 'katakana'], ''],
         [['有り難う', '', 'romaji'], ''],
-        [['有り難う', '', 'none'], null],
-        [['有り難う', '', 'default'], ''],
-
-        [['有り難う', null, 'hiragana'], ''],
-        [['有り難う', null, 'katakana'], ''],
-        [['有り難う', null, 'romaji'], null],
-        [['有り難う', null, 'none'], null],
-        [['有り難う', null, 'default'], null],
-
-        [['有り難う', void 0, 'hiragana'], ''],
-        [['有り難う', void 0, 'katakana'], ''],
-        [['有り難う', void 0, 'romaji'], void 0],
-        [['有り難う', void 0, 'none'], null],
-        [['有り難う', void 0, 'default'], void 0]
+        [['有り難う', '', 'none'], ''],
+        [['有り難う', '', 'default'], '']
     ];
 
     for (const [[expressionFragment, readingFragment, readingMode], expected] of data) {
@@ -303,9 +279,9 @@ function testDistributeFurigana() {
             ['有り難う', 'ありがとう'],
             [
                 {text: '有', furigana: 'あ'},
-                {text: 'り'},
+                {text: 'り', furigana: ''},
                 {text: '難', furigana: 'がと'},
-                {text: 'う'}
+                {text: 'う', furigana: ''}
             ]
         ],
         [
@@ -317,23 +293,23 @@ function testDistributeFurigana() {
         [
             ['お祝い', 'おいわい'],
             [
-                {text: 'お'},
+                {text: 'お', furigana: ''},
                 {text: '祝', furigana: 'いわ'},
-                {text: 'い'}
+                {text: 'い', furigana: ''}
             ]
         ],
         [
             ['美味しい', 'おいしい'],
             [
                 {text: '美味', furigana: 'おい'},
-                {text: 'しい'}
+                {text: 'しい', furigana: ''}
             ]
         ],
         [
             ['食べ物', 'たべもの'],
             [
                 {text: '食', furigana: 'た'},
-                {text: 'べ'},
+                {text: 'べ', furigana: ''},
                 {text: '物', furigana: 'もの'}
             ]
         ],
@@ -341,9 +317,9 @@ function testDistributeFurigana() {
             ['試し切り', 'ためしぎり'],
             [
                 {text: '試', furigana: 'ため'},
-                {text: 'し'},
+                {text: 'し', furigana: ''},
                 {text: '切', furigana: 'ぎ'},
-                {text: 'り'}
+                {text: 'り', furigana: ''}
             ]
         ],
         // Ambiguous
@@ -373,16 +349,16 @@ function testDistributeFuriganaInflected() {
             ['美味しい', 'おいしい', '美味しかた'],
             [
                 {text: '美味', furigana: 'おい'},
-                {text: 'し'},
-                {text: 'かた'}
+                {text: 'し', furigana: ''},
+                {text: 'かた', furigana: ''}
             ]
         ],
         [
             ['食べる', 'たべる', '食べた'],
             [
                 {text: '食', furigana: 'た'},
-                {text: 'べ'},
-                {text: 'た'}
+                {text: 'べ', furigana: ''},
+                {text: 'た', furigana: ''}
             ]
         ]
     ];
-- 
cgit v1.2.3


From 3fa8b8e1866933fdfccd0598a11e443fc1693840 Mon Sep 17 00:00:00 2001
From: siikamiika 
Date: Tue, 14 Apr 2020 21:21:52 +0300
Subject: prevent infinite loop if source length is 0

---
 ext/bg/js/backend.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'ext/bg/js/backend.js')

diff --git a/ext/bg/js/backend.js b/ext/bg/js/backend.js
index d5086af2..960c65bf 100644
--- a/ext/bg/js/backend.js
+++ b/ext/bg/js/backend.js
@@ -324,7 +324,7 @@ class Backend {
                 {},
                 options
             );
-            if (definitions.length > 0) {
+            if (definitions.length > 0 && sourceLength > 0) {
                 dictTermsSort(definitions);
                 const {expression, reading} = definitions[0];
                 const source = text.substring(0, sourceLength);
-- 
cgit v1.2.3


From 619df42aedaa8da97d0a16d539b7211349143a0a Mon Sep 17 00:00:00 2001
From: siikamiika 
Date: Tue, 14 Apr 2020 21:25:02 +0300
Subject: simplify to enable constant usage

---
 ext/bg/js/backend.js | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

(limited to 'ext/bg/js/backend.js')

diff --git a/ext/bg/js/backend.js b/ext/bg/js/backend.js
index 960c65bf..f8b0fc96 100644
--- a/ext/bg/js/backend.js
+++ b/ext/bg/js/backend.js
@@ -349,11 +349,10 @@ class Backend {
         for (const [mecabName, parsedLines] of Object.entries(rawResults)) {
             const result = [];
             for (const parsedLine of parsedLines) {
-                for (let {expression, reading, source} of parsedLine) {
+                for (const {expression, reading, source} of parsedLine) {
                     const term = [];
-                    if (expression === '') { expression = source; }
                     for (const {text: text2, furigana} of jp.distributeFuriganaInflected(
-                        expression,
+                        expression.length > 0 ? expression : source,
                         jp.convertKatakanaToHiragana(reading),
                         source
                     )) {
-- 
cgit v1.2.3