summaryrefslogtreecommitdiff
path: root/ext/js/display
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2023-12-18 23:22:05 -0500
committerGitHub <noreply@github.com>2023-12-19 04:22:05 +0000
commit1d268edcc3efce723954bcaa7dd376f0352c1a32 (patch)
tree8ca08980837206dc5d309fa20f2d29fbd336a498 /ext/js/display
parent5a3d23e7c20e6869b2ae10d5bc478c5552bc41e8 (diff)
Remove dynamic-loader scripts, simplify script loading (#383)
Diffstat (limited to 'ext/js/display')
-rw-r--r--ext/js/display/display.js20
1 files changed, 5 insertions, 15 deletions
diff --git a/ext/js/display/display.js b/ext/js/display/display.js
index 945ec0b9..d7b8f898 100644
--- a/ext/js/display/display.js
+++ b/ext/js/display/display.js
@@ -16,8 +16,6 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
-import {Frontend} from '../app/frontend.js';
-import {PopupFactory} from '../app/popup-factory.js';
import {ThemeController} from '../app/theme-controller.js';
import {FrameEndpoint} from '../comm/frame-endpoint.js';
import {DynamicProperty, EventDispatcher, EventListenerCollection, clone, deepEqual, invokeMessageHandler, log, promiseTimeout} from '../core.js';
@@ -26,7 +24,6 @@ import {querySelectorNotNull} from '../dom/query-selector.js';
import {ScrollElement} from '../dom/scroll-element.js';
import {HotkeyHelpController} from '../input/hotkey-help-controller.js';
import {TextScanner} from '../language/text-scanner.js';
-import {dynamicLoader} from '../script/dynamic-loader.js';
import {yomitan} from '../yomitan.js';
import {DisplayContentManager} from './display-content-manager.js';
import {DisplayGenerator} from './display-generator.js';
@@ -145,7 +142,7 @@ export class Display extends EventDispatcher {
this._navigationPreviousButton = document.querySelector('#navigate-previous-button');
/** @type {?HTMLButtonElement} */
this._navigationNextButton = document.querySelector('#navigate-next-button');
- /** @type {?Frontend} */
+ /** @type {?import('../app/frontend.js').Frontend} */
this._frontend = null;
/** @type {?Promise<void>} */
this._frontendSetupPromise = null;
@@ -1707,7 +1704,7 @@ export class Display extends EventDispatcher {
}
}
- /** @type {Frontend} */ (this._frontend).setDisabledOverride(!isEnabled);
+ /** @type {import('../app/frontend.js').Frontend} */ (this._frontend).setDisabledOverride(!isEnabled);
}
/** */
@@ -1720,16 +1717,9 @@ export class Display extends EventDispatcher {
const parentPopupId = this._parentPopupId;
const parentFrameId = this._parentFrameId;
- await dynamicLoader.loadScripts([
- '/js/language/text-scanner.js',
- '/js/comm/frame-client.js',
- '/js/app/popup.js',
- '/js/app/popup-proxy.js',
- '/js/app/popup-window.js',
- '/js/app/popup-factory.js',
- '/js/comm/frame-ancestry-handler.js',
- '/js/comm/frame-offset-forwarder.js',
- '/js/app/frontend.js'
+ const [{PopupFactory}, {Frontend}] = await Promise.all([
+ import('../app/popup-factory.js'),
+ import('../app/frontend.js')
]);
const popupFactory = new PopupFactory(this._frameId);