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");
});
端口API仅支持JSON可序列化的数据。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.