Rename apiForward to apiBroadcast
This commit is contained in:
parent
96566b8581
commit
a2b66dc6cc
@ -94,7 +94,7 @@ class Backend {
|
|||||||
['commandExec', {handler: this._onApiCommandExec.bind(this), async: false}],
|
['commandExec', {handler: this._onApiCommandExec.bind(this), async: false}],
|
||||||
['audioGetUri', {handler: this._onApiAudioGetUri.bind(this), async: true}],
|
['audioGetUri', {handler: this._onApiAudioGetUri.bind(this), async: true}],
|
||||||
['screenshotGet', {handler: this._onApiScreenshotGet.bind(this), async: true}],
|
['screenshotGet', {handler: this._onApiScreenshotGet.bind(this), async: true}],
|
||||||
['forward', {handler: this._onApiForward.bind(this), async: false}],
|
['broadcast', {handler: this._onApiBroadcast.bind(this), async: false}],
|
||||||
['frameInformationGet', {handler: this._onApiFrameInformationGet.bind(this), async: true}],
|
['frameInformationGet', {handler: this._onApiFrameInformationGet.bind(this), async: true}],
|
||||||
['injectStylesheet', {handler: this._onApiInjectStylesheet.bind(this), async: true}],
|
['injectStylesheet', {handler: this._onApiInjectStylesheet.bind(this), async: true}],
|
||||||
['getEnvironmentInfo', {handler: this._onApiGetEnvironmentInfo.bind(this), async: true}],
|
['getEnvironmentInfo', {handler: this._onApiGetEnvironmentInfo.bind(this), async: true}],
|
||||||
@ -567,7 +567,7 @@ class Backend {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
_onApiForward({action, params}, sender) {
|
_onApiBroadcast({action, params}, sender) {
|
||||||
if (!(sender && sender.tab)) {
|
if (!(sender && sender.tab)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
/* global
|
/* global
|
||||||
* Display
|
* Display
|
||||||
* apiForward
|
* apiBroadcast
|
||||||
* apiGetMessageToken
|
* apiGetMessageToken
|
||||||
* popupNestedInitialize
|
* popupNestedInitialize
|
||||||
*/
|
*/
|
||||||
@ -80,7 +80,7 @@ class DisplayFloat extends Display {
|
|||||||
|
|
||||||
this.setContentScale(scale);
|
this.setContentScale(scale);
|
||||||
|
|
||||||
apiForward('popupPrepareCompleted', {targetPopupId: this._popupId});
|
apiBroadcast('popupPrepareCompleted', {targetPopupId: this._popupId});
|
||||||
}
|
}
|
||||||
|
|
||||||
onError(error) {
|
onError(error) {
|
||||||
@ -181,7 +181,7 @@ class DisplayFloat extends Display {
|
|||||||
},
|
},
|
||||||
2000
|
2000
|
||||||
);
|
);
|
||||||
apiForward('requestDocumentInformationBroadcast', {uniqueId});
|
apiBroadcast('requestDocumentInformationBroadcast', {uniqueId});
|
||||||
|
|
||||||
const {title} = await promise;
|
const {title} = await promise;
|
||||||
return title;
|
return title;
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* global
|
/* global
|
||||||
* apiForward
|
* apiBroadcast
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class FrameOffsetForwarder {
|
class FrameOffsetForwarder {
|
||||||
@ -97,6 +97,6 @@ class FrameOffsetForwarder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_forwardFrameOffsetOrigin(offset, uniqueId) {
|
_forwardFrameOffsetOrigin(offset, uniqueId) {
|
||||||
apiForward('frameOffset', {offset, uniqueId});
|
apiBroadcast('frameOffset', {offset, uniqueId});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
* Frontend
|
* Frontend
|
||||||
* PopupProxy
|
* PopupProxy
|
||||||
* PopupProxyHost
|
* PopupProxyHost
|
||||||
* apiForward
|
* apiBroadcast
|
||||||
* apiOptionsGet
|
* apiOptionsGet
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -44,7 +44,7 @@ async function main() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
apiForward('rootPopupRequestInformationBroadcast');
|
apiBroadcast('rootPopupRequestInformationBroadcast');
|
||||||
const {popupId, frameId} = await rootPopupInformationPromise;
|
const {popupId, frameId} = await rootPopupInformationPromise;
|
||||||
|
|
||||||
const frameOffsetForwarder = new FrameOffsetForwarder();
|
const frameOffsetForwarder = new FrameOffsetForwarder();
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
/* global
|
/* global
|
||||||
* TextScanner
|
* TextScanner
|
||||||
* apiForward
|
* apiBroadcast
|
||||||
* apiGetZoom
|
* apiGetZoom
|
||||||
* apiKanjiFind
|
* apiKanjiFind
|
||||||
* apiOptionsGet
|
* apiOptionsGet
|
||||||
@ -261,12 +261,12 @@ class Frontend extends TextScanner {
|
|||||||
|
|
||||||
_broadcastRootPopupInformation() {
|
_broadcastRootPopupInformation() {
|
||||||
if (!this.popup.isProxy() && this.popup.depth === 0) {
|
if (!this.popup.isProxy() && this.popup.depth === 0) {
|
||||||
apiForward('rootPopupInformation', {popupId: this.popup.id, frameId: this.popup.frameId});
|
apiBroadcast('rootPopupInformation', {popupId: this.popup.id, frameId: this.popup.frameId});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_broadcastDocumentInformation(uniqueId) {
|
_broadcastDocumentInformation(uniqueId) {
|
||||||
apiForward('documentInformationBroadcast', {
|
apiBroadcast('documentInformationBroadcast', {
|
||||||
uniqueId,
|
uniqueId,
|
||||||
frameId: this.popup.frameId,
|
frameId: this.popup.frameId,
|
||||||
title: document.title
|
title: document.title
|
||||||
|
@ -81,8 +81,8 @@ function apiScreenshotGet(options) {
|
|||||||
return _apiInvoke('screenshotGet', {options});
|
return _apiInvoke('screenshotGet', {options});
|
||||||
}
|
}
|
||||||
|
|
||||||
function apiForward(action, params) {
|
function apiBroadcast(action, params) {
|
||||||
return _apiInvoke('forward', {action, params});
|
return _apiInvoke('broadcast', {action, params});
|
||||||
}
|
}
|
||||||
|
|
||||||
function apiFrameInformationGet() {
|
function apiFrameInformationGet() {
|
||||||
|
@ -23,9 +23,9 @@
|
|||||||
* DisplayGenerator
|
* DisplayGenerator
|
||||||
* WindowScroll
|
* WindowScroll
|
||||||
* apiAudioGetUri
|
* apiAudioGetUri
|
||||||
|
* apiBroadcast
|
||||||
* apiDefinitionAdd
|
* apiDefinitionAdd
|
||||||
* apiDefinitionsAddable
|
* apiDefinitionsAddable
|
||||||
* apiForward
|
|
||||||
* apiKanjiFind
|
* apiKanjiFind
|
||||||
* apiNoteView
|
* apiNoteView
|
||||||
* apiOptionsGet
|
* apiOptionsGet
|
||||||
@ -855,7 +855,7 @@ class Display {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setPopupVisibleOverride(visible) {
|
setPopupVisibleOverride(visible) {
|
||||||
return apiForward('popupSetVisibleOverride', {visible});
|
return apiBroadcast('popupSetVisibleOverride', {visible});
|
||||||
}
|
}
|
||||||
|
|
||||||
setSpinnerVisible(visible) {
|
setSpinnerVisible(visible) {
|
||||||
|
Loading…
Reference in New Issue
Block a user