MozillaZine

Cross-window background code... Ideas/Explanation?

Talk about add-ons and extension development.
Mook
 
Posts: 1752
Joined: November 7th, 2002, 9:35 pm

Post Posted February 5th, 2006, 6:14 pm

hmm, am I the only person to be crazy enough to write the module loader code in an external file, and use the JS subscript loader to dynamically load in my actual component implementations? :) (i.e. the actually implementation JS don't have the module stuff, so they get ignored by the component loader, and the file with the module stuff is in a separate file. See about:kitchensink for impl details.)

The advantage being I pretty much don't have to write module stuff again, just tweak the file names and class names :)
poot.

richwklein
 
Posts: 331
Joined: November 24th, 2002, 8:20 pm
Location: Iowa

Post Posted February 6th, 2006, 8:31 am

Mook wrote:hmm, am I the only person to be crazy enough to write the module loader code in an external file, and use the JS subscript loader to dynamically load in my actual component implementations? :) (i.e. the actually implementation JS don't have the module stuff, so they get ignored by the component loader, and the file with the module stuff is in a separate file. See about:kitchensink for impl details.)

The advantage being I pretty much don't have to write module stuff again, just tweak the file names and class names :)


I've thought about doing this. What I would really like to do is use the javascript loader only when the nsIFactory createInstance is called, so that the files are loaded lazily when the class is created.


On a side note, I've started to put together an example of creating javascript xpcom objects in the knowledge base, but it isn't finished yet.
My Extensions:
<a href="http://forecastfox.mozdev.org">Forecastfox</a>
<a href="http://tipbar.mozdev.org">Tip of the Day</a>
<a href="http://urlnav.mozdev.org">Location Navigator</a>
<a href="http://finder.mozdev.org">Finder</a>
<a href="http://rsszilla.mozdev.org">RSSzilla</a>

Daniel_Orner
 
Posts: 118
Joined: May 26th, 2005, 11:06 am

Post Posted February 6th, 2006, 9:24 am

I'm not sure I understand that... what's the difference between a "function call" and a "method call"?

And how exactly would I get around it in the service code? I'm declaring a function and a function prototype, so I don't actually *have* an object to pass or reference anywhere...

ericjung
 
Posts: 846
Joined: August 4th, 2003, 9:32 am

Post Posted February 6th, 2006, 1:13 pm


asqueella
 
Posts: 4019
Joined: November 16th, 2003, 3:05 am
Location: Russia, Moscow

Post Posted February 7th, 2006, 7:24 am

Yes, it's great that you're doing it.

I moved the page to http://kb.mozillazine.org/Implementing_ ... JavaScript though - we have decided to switch off the older naming scheme quite a while ago.

Daniel_Orner: let's take it to a separate thread, ok? (And please describe the situation again there)

Daniel_Orner
 
Posts: 118
Joined: May 26th, 2005, 11:06 am

Post Posted February 7th, 2006, 8:55 am

No problem.

Return to Extension Development


Who is online

Users browsing this forum: No registered users and 3 guests