diff options
Diffstat (limited to 'ext')
-rw-r--r-- | ext/mixed/js/display.js | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/ext/mixed/js/display.js b/ext/mixed/js/display.js index 646d60e7..64c604e8 100644 --- a/ext/mixed/js/display.js +++ b/ext/mixed/js/display.js @@ -908,12 +908,17 @@ class Display { async getDefinitionsAddable(definitions, modes) { try { - return await apiDefinitionsAddable(definitions, modes, this._getNoteContext(), this.getOptionsContext()); + const context = await this._getNoteContext(); + return await apiDefinitionsAddable(definitions, modes, context, this.getOptionsContext()); } catch (e) { return []; } } + async getDocumentTitle() { + return document.title; + } + static indexOf(nodeList, node) { for (let i = 0, ii = nodeList.length; i < ii; ++i) { if (nodeList[i] === node) { @@ -934,10 +939,11 @@ class Display { return (typeof key === 'string' ? (key.length === 1 ? key.toUpperCase() : key) : ''); } - _getNoteContext() { + async _getNoteContext() { + const documentTitle = await this.getDocumentTitle(); return { document: { - title: document.title + title: documentTitle } }; } |