Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Firefox Extension trigger twice with load function

18 views
Skip to first unread message

Aubrey

unread,
Nov 18, 2010, 2:26:21 AM11/18/10
to

I am new to Firefox extension development.

I have started to work on an extension that triggers when the page has
been loaded. The problem I have is that the event is triggered twice.
Its almost as if two threads are created when the users navigates or
browses web sites.

Why does this happen and how could this be changed to only trigger
once.

I have attached the files.

Here is the browser.xul file

<?xml version="1.0"?>

<!DOCTYPE DOMDropper SYSTEM "chrome://DOMDropper/locale/
translations.dtd">
<overlay id="sample" xmlns="http://www.mozilla.org/keymaster/
gatekeeper/there.is.only.xul">
<script src="blah.js" />
</overlay>

Here is blah.js

var Blah = function () {

return {
init : function () {
gBrowser.addEventListener("load", function () {
Blah.run();
}, false);
},

run : function () {
alert("Trigger!");
}
};
}();
window.addEventListener("load", Blah.init, false);

kushal...@gmail.com

unread,
Feb 15, 2012, 8:10:55 PM2/15/12
to
Did you ever find a solution? I am having the same issue. Let me know.

Thanks,
Kushal

Martijn

unread,
Feb 16, 2012, 4:07:28 AM2/16/12
to kushal...@gmail.com, dev-apps...@lists.mozilla.org
Hi Kushal,

Perhaps, if you could show an example extension, other people might be
able to help you find the cause of this problem.

Regards,
Martijn
> _______________________________________________
> dev-apps-firefox mailing list
> dev-apps...@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-apps-firefox



--
Martijn Wargers - Help Mozilla!
http://quality.mozilla.org/
http://wiki.mozilla.org/Mozilla_QA_Community
irc://irc.mozilla.org/qa - /nick mw22
0 new messages