diff options
Diffstat (limited to 'content_scripts/vomnibar.js')
| -rw-r--r-- | content_scripts/vomnibar.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/content_scripts/vomnibar.js b/content_scripts/vomnibar.js index 3add1e6a..0144f87a 100644 --- a/content_scripts/vomnibar.js +++ b/content_scripts/vomnibar.js @@ -195,12 +195,15 @@ var vomnibar = (function() { var id = utils.createUniqueId(); this.filterPort.onMessage.addListener(function(msg) { if (msg.id != id) return; - callback(msg.results.map(function(result) { - // functionName will be either "navigateToUrl" or "switchToTab". args will be a URL or a tab ID. + // The result objects coming from the background page will be of the form: + // { html: "", action: { functionName: "", args: [] } } + // functionName will be either "navigateToUrl" or "switchToTab". args will be a URL or a tab ID. + var results = msg.results.map(function(result) { var functionToCall = completionActions[result.action.functionName]; result.performAction = functionToCall.curry(result.action.args); return result; - })); + }); + callback(results); }); this.filterPort.postMessage({ id: id, name: this.name, query: query, maxResults: maxResults }); } |
