summaryrefslogtreecommitdiff
path: root/ext/fg/js/float.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/fg/js/float.js')
-rw-r--r--ext/fg/js/float.js21
1 files changed, 2 insertions, 19 deletions
diff --git a/ext/fg/js/float.js b/ext/fg/js/float.js
index 83c542d1..8a17a437 100644
--- a/ext/fg/js/float.js
+++ b/ext/fg/js/float.js
@@ -69,25 +69,8 @@ class DisplayFloat extends Display {
async getDocumentTitle() {
try {
- const uniqueId = yomichan.generateId(16);
-
- const promise = yomichan.getTemporaryListenerResult(
- chrome.runtime.onMessage,
- ({action, params}, {resolve}) => {
- if (
- action === 'documentInformationBroadcast' &&
- isObject(params) &&
- params.uniqueId === uniqueId &&
- params.frameId === 0
- ) {
- resolve(params);
- }
- },
- 2000
- );
- api.broadcastTab('requestDocumentInformationBroadcast', {uniqueId});
-
- const {title} = await promise;
+ const targetFrameId = 0;
+ const {title} = await api.crossFrame.invoke(targetFrameId, 'getDocumentInformation');
return title;
} catch (e) {
return '';