From 6c341a13d813fc63b76fbbffe7920eeaf116d3a8 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Sat, 2 May 2020 12:50:44 -0400 Subject: Refactor frontend API classes (#482) * Mark functions as private * Remove constructor side effects * Use safer handler invocation * Mark functions as private * Mark fields as private * Update BackendApiForwarder public API --- ext/fg/js/popup-proxy-host.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ext/fg/js/popup-proxy-host.js') diff --git a/ext/fg/js/popup-proxy-host.js b/ext/fg/js/popup-proxy-host.js index d87553e6..39150bc7 100644 --- a/ext/fg/js/popup-proxy-host.js +++ b/ext/fg/js/popup-proxy-host.js @@ -24,7 +24,6 @@ class PopupProxyHost { constructor() { this._popups = new Map(); - this._apiReceiver = null; this._frameId = null; } @@ -35,7 +34,7 @@ class PopupProxyHost { if (typeof frameId !== 'number') { return; } this._frameId = frameId; - this._apiReceiver = new FrontendApiReceiver(`popup-proxy-host#${this._frameId}`, new Map([ + const apiReceiver = new FrontendApiReceiver(`popup-proxy-host#${this._frameId}`, new Map([ ['getOrCreatePopup', this._onApiGetOrCreatePopup.bind(this)], ['setOptionsContext', this._onApiSetOptionsContext.bind(this)], ['hide', this._onApiHide.bind(this)], @@ -48,6 +47,7 @@ class PopupProxyHost { ['setContentScale', this._onApiSetContentScale.bind(this)], ['getHostUrl', this._onApiGetHostUrl.bind(this)] ])); + apiReceiver.prepare(); } getOrCreatePopup(id=null, parentId=null, depth=null) { -- cgit v1.2.3