diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2021-11-21 15:54:58 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-21 15:54:58 -0500 |
commit | 005f9658d98143ea1189482ae627405c8bf5a566 (patch) | |
tree | 712732685dd3300ad9403f17d2937486e3835661 /ext/js/app/frontend.js | |
parent | 06e70c1cd8a6e23b54ba9081caf82902820ceccd (diff) |
Action handler name disambiguation (#2018)
* Disambiguate PopupFactory action handlers
* Update HotkeyHandler action names
* Disambiguate Frontend action handlers
* Disambiguate Display action handlers
* Disambiguate PopupPreviewFrame action handlers
* Disambiguate Yomichan action handlers
* Disambiguate Frontend action handlers
* Disambiguate Display action handlers
* Disambiguate SearchDisplayController action handlers
Diffstat (limited to 'ext/js/app/frontend.js')
-rw-r--r-- | ext/js/app/frontend.js | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/ext/js/app/frontend.js b/ext/js/app/frontend.js index 0f72e06b..3b482ad2 100644 --- a/ext/js/app/frontend.js +++ b/ext/js/app/frontend.js @@ -92,9 +92,9 @@ class Frontend { this._optionsContextOverride = null; this._runtimeMessageHandlers = new Map([ - ['requestFrontendReadyBroadcast', {async: false, handler: this._onMessageRequestFrontendReadyBroadcast.bind(this)}], - ['setAllVisibleOverride', {async: true, handler: this._onApiSetAllVisibleOverride.bind(this)}], - ['clearAllVisibleOverride', {async: true, handler: this._onApiClearAllVisibleOverride.bind(this)}] + ['Frontend.requestReadyBroadcast', {async: false, handler: this._onMessageRequestFrontendReadyBroadcast.bind(this)}], + ['Frontend.setAllVisibleOverride', {async: true, handler: this._onApiSetAllVisibleOverride.bind(this)}], + ['Frontend.clearAllVisibleOverride', {async: true, handler: this._onApiClearAllVisibleOverride.bind(this)}] ]); this._hotkeyHandler.registerActions([ @@ -159,11 +159,11 @@ class Frontend { this._textScanner.on('searched', this._onSearched.bind(this)); yomichan.crossFrame.registerHandlers([ - ['closePopup', {async: false, handler: this._onApiClosePopup.bind(this)}], - ['copySelection', {async: false, handler: this._onApiCopySelection.bind(this)}], - ['getSelectionText', {async: false, handler: this._onApiGetSelectionText.bind(this)}], - ['getPopupInfo', {async: false, handler: this._onApiGetPopupInfo.bind(this)}], - ['getPageInfo', {async: false, handler: this._onApiGetPageInfo.bind(this)}] + ['Frontend.closePopup', {async: false, handler: this._onApiClosePopup.bind(this)}], + ['Frontend.copySelection', {async: false, handler: this._onApiCopySelection.bind(this)}], + ['Frontend.getSelectionText', {async: false, handler: this._onApiGetSelectionText.bind(this)}], + ['Frontend.getPopupInfo', {async: false, handler: this._onApiGetPopupInfo.bind(this)}], + ['Frontend.getPageInfo', {async: false, handler: this._onApiGetPageInfo.bind(this)}] ]); this._updateContentScale(); @@ -509,7 +509,7 @@ class Frontend { return await this._getDefaultPopup(); } - const {popupId} = await yomichan.crossFrame.invoke(targetFrameId, 'getPopupInfo'); + const {popupId} = await yomichan.crossFrame.invoke(targetFrameId, 'Frontend.getPopupInfo'); if (popupId === null) { return null; } @@ -702,7 +702,7 @@ class Frontend { } chrome.runtime.onMessage.addListener(onMessage); - yomichan.api.broadcastTab('requestFrontendReadyBroadcast', {frameId: this._frameId}); + yomichan.api.broadcastTab('Frontend.requestReadyBroadcast', {frameId: this._frameId}); }); } @@ -728,7 +728,7 @@ class Frontend { let documentTitle = document.title; if (this._useProxyPopup) { try { - ({url, documentTitle} = await yomichan.crossFrame.invoke(this._parentFrameId, 'getPageInfo', {})); + ({url, documentTitle} = await yomichan.crossFrame.invoke(this._parentFrameId, 'Frontend.getPageInfo', {})); } catch (e) { // NOP } |