diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2020-04-06 18:55:36 -0400 |
---|---|---|
committer | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2020-04-06 18:55:36 -0400 |
commit | 696897f6fa431c0c24332c5dd2a2c12a07923c0e (patch) | |
tree | 3216fa4998d8500760116381bbebde9456982036 /ext/fg/js/frontend.js | |
parent | 199b926f239ddf64c95f23415851a11ba4bf7c2a (diff) |
Add support for getting the document title
Diffstat (limited to 'ext/fg/js/frontend.js')
-rw-r--r-- | ext/fg/js/frontend.js | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/ext/fg/js/frontend.js b/ext/fg/js/frontend.js index 4e9d474c..31843212 100644 --- a/ext/fg/js/frontend.js +++ b/ext/fg/js/frontend.js @@ -54,7 +54,8 @@ class Frontend extends TextScanner { this._runtimeMessageHandlers = new Map([ ['popupSetVisibleOverride', ({visible}) => { this.popup.setVisibleOverride(visible); }], - ['rootPopupRequestInformationBroadcast', () => { this._broadcastRootPopupInformation(); }] + ['rootPopupRequestInformationBroadcast', () => { this._broadcastRootPopupInformation(); }], + ['requestDocumentInformationBroadcast', ({uniqueId}) => { this._broadcastDocumentInformation(uniqueId); }] ]); } @@ -264,6 +265,14 @@ class Frontend extends TextScanner { } } + _broadcastDocumentInformation(uniqueId) { + apiForward('documentInformationBroadcast', { + uniqueId, + frameId: this.popup.frameId, + title: document.title + }); + } + async _updatePopupPosition() { const textSource = this.getCurrentTextSource(); if (textSource !== null && await this.popup.isVisible()) { |