diff options
Diffstat (limited to 'ext/js/display/popup-main.js')
-rw-r--r-- | ext/js/display/popup-main.js | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/ext/js/display/popup-main.js b/ext/js/display/popup-main.js index 870e039e..2ca2fcd3 100644 --- a/ext/js/display/popup-main.js +++ b/ext/js/display/popup-main.js @@ -16,10 +16,10 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ +import {Application} from '../application.js'; import {log} from '../core/logger.js'; import {DocumentFocusController} from '../dom/document-focus-controller.js'; import {HotkeyHandler} from '../input/hotkey-handler.js'; -import {yomitan} from '../yomitan.js'; import {DisplayAnki} from './display-anki.js'; import {DisplayAudio} from './display-audio.js'; import {DisplayProfileSelection} from './display-profile-selection.js'; @@ -32,14 +32,15 @@ async function main() { const documentFocusController = new DocumentFocusController(); documentFocusController.prepare(); - await yomitan.prepare(); + const application = new Application(); + await application.prepare(); - const {tabId, frameId} = await yomitan.api.frameInformationGet(); + const {tabId, frameId} = await application.api.frameInformationGet(); const hotkeyHandler = new HotkeyHandler(); - hotkeyHandler.prepare(); + hotkeyHandler.prepare(application.crossFrame); - const display = new Display(tabId, frameId, 'popup', documentFocusController, hotkeyHandler); + const display = new Display(application, tabId, frameId, 'popup', documentFocusController, hotkeyHandler); await display.prepare(); const displayAudio = new DisplayAudio(display); @@ -58,7 +59,7 @@ async function main() { document.documentElement.dataset.loaded = 'true'; - yomitan.ready(); + application.ready(); } catch (e) { log.error(e); } |