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

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

Post by Mook »

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
Contact:

Post by richwklein »

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 by Daniel_Orner »

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 by ericjung »

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

Post by asqueella »

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 by Daniel_Orner »

No problem.
Locked