From b7c9fa105764eb2cd5befea86c98fe49f5763a1d Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Tue, 12 Jan 2021 18:04:26 -0500 Subject: Refactor note document title (#1227) * Pass url into setContent * Update where url is checked from * Add documentTitle to state information * Update how _getNoteContext gets the document title * Update how url is fetched for options context * Pass document title in to 'searched' event --- ext/bg/js/search.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'ext/bg/js') diff --git a/ext/bg/js/search.js b/ext/bg/js/search.js index 1417bdb5..991acf2b 100644 --- a/ext/bg/js/search.js +++ b/ext/bg/js/search.js @@ -349,6 +349,9 @@ class DisplaySearch extends Display { _search(animate, history) { const query = this._queryInput.value; + const depth = this.depth; + const url = window.location.href; + const documentTitle = document.title; const details = { focus: false, history, @@ -357,8 +360,10 @@ class DisplaySearch extends Display { }, state: { focusEntry: 0, + optionsContext: {depth, url}, + url, sentence: {text: query, offset: 0}, - url: window.location.href + documentTitle }, content: { definitions: null, -- cgit v1.2.3