Assume a panel injected:
//main.js
var ext = require("sdk/panel").Panel({
width: 300,
height: 500,
contentScriptFile: [data.url("js/angular/angular.min.js"),
data.url("js/angular/angular-route.js"),
data.url("js/app.js"),
data.url("js/utilities.js"),
data.url("js/services.js"),
data.url("js/directives.js"),
data.url("js/controllers.js"),
data.url("js/popup.js")],
contentScriptWhen: "ready"
});
I can attach a listener to DOM of the active tab to detect some events:
if(window.customObj != undefined)
{
window.postMessage(window.customObj, window.location.href);
}
how to get the object I'm sending by this custom message inside popup.js or main.js?