简体   繁体   中英

How emit function in firefox extension?

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM