summaryrefslogtreecommitdiff
path: root/ext/js/app/popup-proxy.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2024-02-01 10:00:59 -0500
committerGitHub <noreply@github.com>2024-02-01 15:00:59 +0000
commitdfd42bad0b46845ad88d1fdc5fa82b4f03bab0f3 (patch)
tree04686b943b84b33b8927238be17e4bc0dda7eb62 /ext/js/app/popup-proxy.js
parent2356223942a21d1683ac38eed8e7b9485f453d87 (diff)
Application refactor (#591)
* Rename Yomitan class to Application, change initialization style * Rename file * Update init * Update config * Remove dead code
Diffstat (limited to 'ext/js/app/popup-proxy.js')
-rw-r--r--ext/js/app/popup-proxy.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/ext/js/app/popup-proxy.js b/ext/js/app/popup-proxy.js
index 856ec086..3632b8cb 100644
--- a/ext/js/app/popup-proxy.js
+++ b/ext/js/app/popup-proxy.js
@@ -18,7 +18,6 @@
import {EventDispatcher} from '../core/event-dispatcher.js';
import {log} from '../core/logger.js';
-import {yomitan} from '../yomitan.js';
/**
* This class is a proxy for a Popup that is hosted in a different frame.
@@ -31,12 +30,15 @@ export class PopupProxy extends EventDispatcher {
* @param {import('popup').PopupProxyConstructorDetails} details Details about how to set up the instance.
*/
constructor({
+ application,
id,
depth,
frameId,
frameOffsetForwarder
}) {
super();
+ /** @type {import('../application.js').Application} */
+ this._application = application;
/** @type {string} */
this._id = id;
/** @type {number} */
@@ -305,7 +307,7 @@ export class PopupProxy extends EventDispatcher {
* @returns {Promise<import('cross-frame-api').ApiReturn<TName>>}
*/
_invoke(action, params) {
- return yomitan.crossFrame.invoke(this._frameId, action, params);
+ return this._application.crossFrame.invoke(this._frameId, action, params);
}
/**
@@ -320,7 +322,7 @@ export class PopupProxy extends EventDispatcher {
try {
return await this._invoke(action, params);
} catch (e) {
- if (!yomitan.webExtension.unloaded) { throw e; }
+ if (!this._application.webExtension.unloaded) { throw e; }
return defaultReturnValue;
}
}