title: opera extension scripts and communication between them
body: <p>I made an extension to the firefox using Add-on Builder tool. the extension structure is like,</p>
  
  <ol>
  <li><p>main addon code will run 2 content scripts (1 at run and 1 at ready states of document)</p></li>
  <li><p>the results of content scripts are send to main addon code(using "communication between content script and addon code")</p></li>
  <li><p>the main addon code sends this information to 1 more content script.</p></li>
  <li><p>the content script will add the both results and displays when user clicks on a widget </p></li>
  </ol>
  
  <p>Example:</p>
  
  <p><strong>main.js(addon code):</strong></p>
  
  <pre><code>var data = require("self").data;
  
  var paraPanel = require("panel").Panel({
  
    contentScriptFile: data.url("combine.js")
  
  });
  
  require("page-mod").PageMod({
  
    contentScriptWhen: 'start',
  
    contentScriptFile: data.url("content-script1.js"),
  
    onAttach: function (worker) {
  
        worker.port.on("para1", function(message) {
  
        msgfromscript1 = message;
  
      });
  
    }
  
  })
  
  require("page-mod").PageMod({
  
    contentScriptWhen: 'ready',
  
    contentScriptFile: data.url("content-script2.js"),
  
    onAttach: function (worker) {
  
        worker.port.on("para2", function(message) {
  
       msgfromscript2 = message;
  
      });
  
    }
  
  })
  
  
  
  require("widget").Widget({
  
    contentURL: data.url("crack_attack.png"),
  
    onClick: function() {
  
      paraPanel.port.emit("add-para", msgfromscript1,msgfromscript2); 
  
      paraPanel.show();
  
    }
  
  });
  </code></pre>
  
  <p><strong>combine.js code:</strong></p>
  
  <pre><code>self.port.on("add-para", function(msgfromscript1,msgfromscript2) {
  
    var result=msgfromscript1+msgfromscript2;
  
    document.body.innerHTML = result;
  
  });
  </code></pre>
  
  <p>I want to implement the same functionality as Opera extension. How can I do this communication and the display based on a click functionalities in the Opera browser?</p>
  
  <p>Is there any documentation or example Opera extensions which may help me?</p>