Hello --

I'm working on a Firefox extension that will manipulate pages when
they are loaded. I'm watching for the DOMContentLoaded event, but it
seems to fire repeatedly. When I am not connected to the internet,
Firsfox displays the standard "Server not found" message with a single
"HELLO WORLD" inserted at the end, as should happen. However, when I
am connected to the internet, the browswr freezs on page load, and,
after a time, unfreezes and has thousands of "HELLO WORLD"s at the
bottom of the page. The only explanation I can think of is that
DOMContentLoaded is fired many times.

I'm using Firefox 3.5.2 on Ubuntu x86_64.

Here's the javascript that's loaded from my overlay:


var helloworld = {
onLoad: function() {
this.initialized = true;
this.strings = document.getElementById("helloworld-strings");
this.appcontent = document.getElementById("appcontent");
helloworld.onPageLoad, false);
onPageLoad: function(e) {
content.document.documentElement.innerHTML += '

HELLO WORLD!!!!! p>';

window.addEventListener("load", function(e) { helloworld.onLoad(e); },


and the overlay: