diff options
-rw-r--r-- | ext/bg/js/search.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/ext/bg/js/search.js b/ext/bg/js/search.js index 2dd4e758..c692a859 100644 --- a/ext/bg/js/search.js +++ b/ext/bg/js/search.js @@ -54,6 +54,10 @@ class DisplaySearch extends Display { ['AltGraph', []], ['Shift', []] ]); + + this._runtimeMessageHandlers = new Map([ + ['searchQueryUpdate', ({query}) => { this.onExternalSearchUpdate(query); }] + ]); } static create() { @@ -156,10 +160,10 @@ class DisplaySearch extends Display { } onRuntimeMessage({action, params}, sender, callback) { - const handler = DisplaySearch._runtimeMessageHandlers.get(action); + const handler = this._runtimeMessageHandlers.get(action); if (typeof handler !== 'function') { return false; } - const result = handler(this, params, sender); + const result = handler(params, sender); callback(result); return false; } @@ -360,8 +364,4 @@ class DisplaySearch extends Display { } } -DisplaySearch._runtimeMessageHandlers = new Map([ - ['searchQueryUpdate', (self, {query}) => { self.onExternalSearchUpdate(query); }] -]); - DisplaySearch.instance = DisplaySearch.create(); |