title: When i add contentscript using page-mod in firefox extension. The content script functions are executed thrice
body: <p>I am unable to understand . Why my functions are executed thrice after addition in the firefox extension using "page-mod" .</p>
  
  <p>This is my code :
  [<strong>main.js</strong>]</p>
  
  <pre><code>var pageModOptions = {
      include: ["http://xyz.com/*"],
      attachTo: ["top", "frame", "existing"],
      contentScriptWhen: "end",
      onAttach: function(worker){
          worker.port.on("Done", function(elementContent) {
              console.log("emitted by tarun :" + elementContent);
              worker.port.emit("start", htmlfilePath);
          });
      },
  };
  
  pageModOptions.contentScriptFile = [data.url("js/main.js"),data.url("js/jquery-1.8.2.min.js"),data.url("js/hello.js")];
  
  //pageModOptions.contentScriptFile = data.url("js/jquery-1.8.2.min.js");
  pageModOptions.contentStyleFile = data.url("js/main.css");
  pageModOptions.contentScriptOptions = csOptions;
  pageMod.PageMod(pageModOptions); 
  </code></pre>
  
  <p>and in the contentscript [<strong>hello.js</strong>]</p>
  
  <pre><code>function test(){
      window.alert('testing phase 1');
  }
  test();
  </code></pre>
  
  <p>So this alert is called thrice . How to stop this behaviour . </p>