title: DOMContentLoaded only once
body: <p>I'm using this code for firefox extension</p>
  
  <pre><code>1: var Test {
  2:  f: function() {
  3:    alert("DOM content loaded");
  4:    window.removeEventListener("DOMContentLoaded", function(e) { Test.f(); }, false);
  5:  }
  6: }
  7: window.addEventListener("DOMContentLoaded", function(e) { Test.f(); }, false);
  </code></pre>
  
  <p>It should execute the code in function f() when DOM content (weg page) was loaded, it means it should give me one alert if I open new page or new tab or reload a page. The problem is, it gives me about 20 alerts, instead of one.<br>
  The problem is even worse if I want in function f() append to every anchor some text (e.g. if I want to append the text "(com)" it will append "(com)(com)(com)(com)(com)"</p>
  
  <p>Do you know how to achieve the behaviour I want?
  <code>removeEventListener</code> didn't help.</p>
  
  <p>The culprit seems to be other firefox extensions and about:blank. Is it possible that my event listener on DOMContentLoaded ignores page loads causes by other  extensions?</p>
  
  <p>thank you</p>