2020-04-19 14:28:29 -04:00
|
|
|
/*
|
2021-01-01 14:50:41 -05:00
|
|
|
* Copyright (C) 2019-2021 Yomichan Authors
|
2020-04-19 14:28:29 -04:00
|
|
|
*
|
|
|
|
* 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
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* global
|
2021-01-17 19:28:42 -05:00
|
|
|
* HotkeyHandler
|
2020-06-21 16:14:05 -04:00
|
|
|
* PopupFactory
|
2020-05-29 20:29:19 -04:00
|
|
|
* PopupPreviewFrame
|
2020-04-19 14:28:29 -04:00
|
|
|
*/
|
|
|
|
|
2020-05-29 20:29:19 -04:00
|
|
|
(async () => {
|
2020-06-21 16:14:05 -04:00
|
|
|
try {
|
2021-02-14 15:19:31 -05:00
|
|
|
await yomichan.prepare();
|
2020-06-21 16:14:05 -04:00
|
|
|
|
2021-02-14 15:53:35 -05:00
|
|
|
const {tabId, frameId} = await yomichan.api.frameInformationGet();
|
2020-06-21 16:14:05 -04:00
|
|
|
|
2021-01-17 19:28:42 -05:00
|
|
|
const hotkeyHandler = new HotkeyHandler();
|
|
|
|
hotkeyHandler.prepare();
|
|
|
|
|
2020-06-21 16:14:05 -04:00
|
|
|
const popupFactory = new PopupFactory(frameId);
|
2020-06-25 18:32:29 -04:00
|
|
|
popupFactory.prepare();
|
2020-06-21 16:14:05 -04:00
|
|
|
|
2021-02-09 22:56:04 -05:00
|
|
|
const preview = new PopupPreviewFrame(tabId, frameId, popupFactory, hotkeyHandler);
|
2020-06-21 16:14:05 -04:00
|
|
|
await preview.prepare();
|
2020-11-06 22:14:00 -05:00
|
|
|
|
|
|
|
document.documentElement.dataset.loaded = 'true';
|
2020-06-21 16:14:05 -04:00
|
|
|
} catch (e) {
|
2021-02-14 17:52:01 -05:00
|
|
|
log.error(e);
|
2020-06-21 16:14:05 -04:00
|
|
|
}
|
2020-04-22 21:42:20 -04:00
|
|
|
})();
|