aboutsummaryrefslogtreecommitdiffstats
path: root/content_scripts/vomnibar.js
diff options
context:
space:
mode:
authorPhil Crosby2012-05-28 10:16:23 -0700
committerPhil Crosby2012-05-28 10:16:23 -0700
commitc676c1e533c0b193450a262544ae115f6710151d (patch)
treed7c0f41301146bffe7f27b466a54c65ef5f6a01f /content_scripts/vomnibar.js
parent7ff0e949f21de79b4054633409e2d9bd24f6456a (diff)
downloadvimium-c676c1e533c0b193450a262544ae115f6710151d.tar.bz2
better explain what we're getting from the background page
Diffstat (limited to 'content_scripts/vomnibar.js')
-rw-r--r--content_scripts/vomnibar.js9
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 });
}