[Project_owners] Initialising an extension once per session

Atul Varma avarma at mozilla.com
Tue Jul 8 06:42:37 PDT 2008


The easier way to do this is via a JS module, though it's only  
supported by Firefox 3:

   http://developer.mozilla.org/en/docs/Using_JavaScript_code_modules

You can see these in use in Mozilla Weave, which uses them  
extensively.  If your extension needs to be compatible with FF2,  
though, then an XPCOM component is the way to go.

- Atul

On Jul 8, 2008, at 5:15 AM, Godmar Back wrote:

> Yes - implement your code as a XPCOM Component:
> http://developer.mozilla.org/en/docs/How_to_Build_an_XPCOM_Component_in_Javascript
>
> - Godmar
>
> On Tue, Jul 8, 2008 at 7:30 AM, Brian King <brian at mozdev.org> wrote:
>> Hi,
>>
>> I initialise my Firefox extensions the standard way as outlined  
>> here (using
>> addEventListener):
>>
>> http://developer.mozilla.org/en/docs/Code_snippets:On_page_load#Running_code_on_an_extension.27s_first_run_or_after_an_extension.27s_update
>>
>> However, this is fired for every new browser window. Is there a way  
>> to make
>> it happen only once per browser session?
>>
>> Notes:
>>
>> -> this is not about first run, but rather run per session
>> -> removing the event listener as in the example does not do it
>> -> i'd like to avoid using prefs if possible
>>
>> - Brian
>> _______________________________________________
>> Project_owners mailing list
>> Project_owners at mozdev.org
>> https://www.mozdev.org/mailman/listinfo/project_owners
>>
> _______________________________________________
> Project_owners mailing list
> Project_owners at mozdev.org
> https://www.mozdev.org/mailman/listinfo/project_owners



More information about the Project_owners mailing list