diff options
Diffstat (limited to 'ext/js/app/popup-proxy.js')
-rw-r--r-- | ext/js/app/popup-proxy.js | 8 |
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; } } |