blob: 78534ef76f2c3ee015e8b52222c1e3c19381b667 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
if (this.chrome) {
// TODO: register receiver for async msg.
chrome.on("asyncy", function() {
console.log("i am an async message from firefox");
});
exports.go = function() {
console.log("about to send sync message to firefox");
chrome.call("superpower");
console.log("returned from sync message to firefox");
};
} else {
exports.register = function(addon) {
addon.registerCall("superpower", function(name) {
addon.send("asyncy");
});
};
}
|