Can i emit function from one file to another in firefox extension? Example:
main.js
data = function() {
return fn();
}
panel.port.emit("resp", data);
panel.js
self.port.on('resp', function(fn) {
return fn("some");
});
The port API only supports JSON-serializeable data.