But I don't recommend to use next line from the example:
Code: Select all
var globalMM = Cc["@mozilla.org/globalmessagemanager;1"]
.getService(Ci.nsIMessageListenerManager);
Because when you use sendAsyncMessage/sendSyncMessage to communicate frame script with chrome script (content to chrome) it sends masses of the same messaging that it is supposed to be send only one time (for e.g. on one middle click) in the case where you open a few FF windows (for e.g. "shift + left mouse click" for links)
It looks like a bug and it's the same behavior in FF 42 stable with sending messages from frame-scripts, not only in 45
For example you have five opened FF windows, so it sends 5 the same messaging (to chrome-script) even if sendAsyncMessage was called only once and if you close 4 windows it is still sends 5 message until you restart FF
So it is better to use the next line:
Code: Select all
var mm = window.messageManager; // or just "messageManager"
and using that variable for loading frame script