Hi everyone,
I am currently working on a project for Firefox OS, and am trying to send
messages from a WebIDL in gecko to a Gaia app.
So far I have found the nsIMessageSender and nsIMessageListenerManager
interfaces that could work for me.
Unfortunately, when I try to invoke the nsIMessageListenerManager interface in
Gaia, The following error appears:
E/TestApp (10202): [JavaScript Error: "The Components object is deprecated. It
will soon be removed." {file:
"app://bf12df6f-7274-4907-8ab4-a8f2501c28e2/app.js" line: 14}]
E/TestApp (10202): [JavaScript Error: "TypeError: Components.utils is
undefined" {file: "app://bf12df6f-7274-4907-8ab4-a8f2501c28e2/app.js" line: 14}]
My code is the following:
Gecko:
XPCOMUtils.defineLazyServiceGetter(this, "cpmm",
"@mozilla.org/childprocessmessagemanager;1", "nsIMessageSender");
cpmm.sendAsyncMessage("PrivacyMonitor:APIRequest", {appName: appName,
permission: permission});
Gaia:
var globalMM = Components.classes["@mozilla.org/cookie-monster;1"]
.getService(Components.interfaces.nsIMessageListenerManager);
globalMM.addMessageListener("PrivacyMonitor:APIRequest", function(obj) {
console.log(obj.appName);
});
I understand that it is not possible to use Components from Gaia anymore, is
there another to use this interface or, if not, another way to communicate from
Gecko to Gaia?
Thank you.
_______________________________________________
dev-fxos mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-fxos