From e3a767876944467b09086501a8b2ef308716090a Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Wed, 9 Sep 2020 12:54:59 -0400 Subject: Anki screenshot refactor (#791) * Use more consistent style for injectScreenshot * Move screenshot generation into AnkiNoteBuilder/Backend * Get optionsContext before await --- ext/fg/js/frontend.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'ext/fg/js') diff --git a/ext/fg/js/frontend.js b/ext/fg/js/frontend.js index e92feaf9..3ddf0d25 100644 --- a/ext/fg/js/frontend.js +++ b/ext/fg/js/frontend.js @@ -67,7 +67,9 @@ class Frontend { this._isPointerOverPopup = false; this._runtimeMessageHandlers = new Map([ - ['requestFrontendReadyBroadcast', {async: false, handler: this._onMessageRequestFrontendReadyBroadcast.bind(this)}] + ['requestFrontendReadyBroadcast', {async: false, handler: this._onMessageRequestFrontendReadyBroadcast.bind(this)}], + ['setAllVisibleOverride', {async: true, handler: this._onApiSetAllVisibleOverride.bind(this)}], + ['clearAllVisibleOverride', {async: true, handler: this._onApiClearAllVisibleOverride.bind(this)}] ]); } @@ -117,9 +119,7 @@ class Frontend { ['closePopup', {async: false, handler: this._onApiClosePopup.bind(this)}], ['copySelection', {async: false, handler: this._onApiCopySelection.bind(this)}], ['getPopupInfo', {async: false, handler: this._onApiGetPopupInfo.bind(this)}], - ['getDocumentInformation', {async: false, handler: this._onApiGetDocumentInformation.bind(this)}], - ['setAllVisibleOverride', {async: true, handler: this._onApiSetAllVisibleOverride.bind(this)}], - ['clearAllVisibleOverride', {async: true, handler: this._onApiClearAllVisibleOverride.bind(this)}] + ['getDocumentInformation', {async: false, handler: this._onApiGetDocumentInformation.bind(this)}] ]); this._updateContentScale(); -- cgit v1.2.3