diff options
Diffstat (limited to 'content_scripts/vomnibar.js')
| -rw-r--r-- | content_scripts/vomnibar.js | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/content_scripts/vomnibar.js b/content_scripts/vomnibar.js index 97f8b1c1..3fedc8c4 100644 --- a/content_scripts/vomnibar.js +++ b/content_scripts/vomnibar.js @@ -195,11 +195,15 @@ var vomnibar = (function() { this.filterPort.onMessage.addListener(function(msg) { if (msg.id != id) return; // 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. + // { html: "", action: "", url: "" } + // action will be either "navigateToUrl" or "switchToTab". var results = msg.results.map(function(result) { - var functionToCall = completionActions[result.action.functionName]; - result.performAction = functionToCall.curry(result.action.args); + var functionToCall = completionActions[result.action]; + if (result.action == "navigateToUrl") + functionToCall = functionToCall.curry(result.url); + else if (result.action == "switchToTab") + functionToCall = functionToCall.curry(result.tabId); + result.performAction = functionToCall; return result; }); callback(results); |
