[Jslib] include JSLib in extension

Henrik Gemal spam at gemal.dk
Fri Jun 18 11:50:00 EDT 2004


My extension Launchy is using JSLib functions. So JSLib needs to be 
installed for Launchy to work.

But since Launchy got listed on update.mozilla.org I got some complains 
about Launchy doesn't work. This is of cause because people dont have 
JSLib installed.

Now I like to include JSLib inside of Launchy. Can I do that and what's 
the smartest way?

I've got it working by including a jslib directory inside my extension's 
jar file. The jslib directory contains the files that I use, mainly 
io/file functions.

So instead of:
<script src="chrome://jslib/content/jslib.js"/>
I use:
<script src="chrome://launchy/content/jslib/jslib.js"/>

I also had to change JS_LIB_PATH in jslib.js from:
const JS_LIB_PATH="chrome://jslib/content/";
to:
const JS_LIB_PATH="chrome://launchy/content/jslib/";

To be fair I also changed JS_LIB_VERSION in jslib.js from:
const JS_LIB_VERSION="0.1.168";
to:
const JS_LIB_VERSION="0.1.168-modified";

Is this the best way to do it? Help!

-- 
Henrik Gemal
Mozilla Evangelist

Mozilla Blog with news, devinfo, links, etc:
http://gemal.dk


More information about the Jslib mailing list