Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Firefox Extension trigger twice with load function
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Aubrey  
View profile  
 More options Nov 18 2010, 2:26 am
Newsgroups: mozilla.dev.apps.firefox
From: Aubrey <aubrey.labuscha...@gmail.com>
Date: Wed, 17 Nov 2010 23:26:21 -0800 (PST)
Local: Thurs, Nov 18 2010 2:26 am
Subject: Firefox Extension trigger twice with load function

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);

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
kushal.kha...@gmail.com  
View profile  
 More options Feb 15 2012, 8:10 pm
Newsgroups: mozilla.dev.apps.firefox
From: kushal.kha...@gmail.com
Date: Wed, 15 Feb 2012 17:10:55 -0800 (PST)
Local: Wed, Feb 15 2012 8:10 pm
Subject: Re: Firefox Extension trigger twice with load function
Did you ever find a solution? I am having the same issue. Let me know.

Thanks,
Kushal


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Martijn  
View profile  
 More options Feb 16 2012, 4:07 am
Newsgroups: mozilla.dev.apps.firefox
From: Martijn <martijn.mart...@gmail.com>
Date: Thu, 16 Feb 2012 10:07:28 +0100
Local: Thurs, Feb 16 2012 4:07 am
Subject: Re: Firefox Extension trigger twice with load function
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

On Thu, Feb 16, 2012 at 2:10 AM,  <kushal.kha...@gmail.com> wrote:
> Did you ever find a solution? I am having the same issue. Let me know.

> Thanks,
> Kushal
> _______________________________________________
> dev-apps-firefox mailing list
> dev-apps-fire...@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

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »