summaryrefslogtreecommitdiff
path: root/ext/mixed/js/api.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-06-07 21:40:11 -0400
committerGitHub <noreply@github.com>2020-06-07 21:40:11 -0400
commit9767b765536279023045ed4280b12d297ec78f0a (patch)
tree672e5754ca6950dbca87e8aabc408ddeba21f9ae /ext/mixed/js/api.js
parentb614aca3ddd04b9d533959b2eabaa6db43b79f8f (diff)
Use cross frame API (#553)
* Use new CrossFrameAPI for popup proxy communication * Remove use of old cross-frame communication classes * Remove use of old cross-frame communication files * Make the crossFrame object a member of the api object
Diffstat (limited to 'ext/mixed/js/api.js')
-rw-r--r--ext/mixed/js/api.js18
1 files changed, 17 insertions, 1 deletions
diff --git a/ext/mixed/js/api.js b/ext/mixed/js/api.js
index 5e3195d6..c54196e2 100644
--- a/ext/mixed/js/api.js
+++ b/ext/mixed/js/api.js
@@ -15,10 +15,23 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
+/* global
+ * CrossFrameAPI
+ */
+
const api = (() => {
class API {
constructor() {
this._forwardLogsToBackendEnabled = false;
+ this._crossFrame = new CrossFrameAPI();
+ }
+
+ get crossFrame() {
+ return this._crossFrame;
+ }
+
+ prepare() {
+ this._crossFrame.prepare();
}
forwardLogsToBackend() {
@@ -331,5 +344,8 @@ const api = (() => {
}
}
- return new API();
+ // eslint-disable-next-line no-shadow
+ const api = new API();
+ api.prepare();
+ return api;
})();