I'm new to the community and to developing addons.
I'm trying to fetch some data from 1 page-worker and sending it to the main addon then include some more data to it and then send it to some other page-worker.
I'm able to do the first part i.e postMessage from page-worker and receive at main addon.
var self = require("sdk/self");
var pageWorker = require("sdk/page-worker");
var getdata = pageWorker.Page({
contentScript: "self.postMessage(document.body.innerHTML);",
contentURL: "http://itildemo.servicedeskplus.com/sdpapi/request?INPUT_DATA={%22operation%22:{%22details%22:{%22status%22:%22open%22,%22from%22:0,%22limit%22:500,%22filterby%22:%22Unassigned_System%22}}}&OPERATION_NAME=GET_REQUESTS&TECHNICIAN_KEY=D357605B-E4B5-4892-A7C2-62CA556CB5A8&format=json" (http://itildemo.servicedeskplus.com/sdpapi/request?INPUT_DATA={%22operation%22:{%22details%22:{%22status%22:%22open%22,%22from%22:0,%22limit%22:500,%22filterby%22:%22Unassigned_System%22}}}&OPERATION_NAME=GET_REQUESTS&TECHNICIAN_KEY=D357605B-E4B5-4892-A7C2-62CA556CB5A8&format=json%27) ,
contentScriptWhen: "ready"
});
getdata.on("message", function(e) {
console.log(e);
});
Now is it possible to postMessage from here to other page-worker like:
getdata.on("message",function(e){
insertdata.postMessage(e);
});
var insertdata = pageWorker.Page({
onMessage: function(e){
console.log(e);
}
});