[Jslib] JSLib files not loaded

Jean-Yves Mertès jym at skynet.be
Thu Dec 9 15:20:50 EST 2004

Hello !

I am just starting using JSLib and experience the same problem as many 
people have already reported. Actually, the JSLib files are not loaded.

Here is the scenery:
- I run Mandrake 10 and Mozilla 1.6
- I have installed JSLib 0.1.235 (as a jar file) in the main Mozilla 
directory and I can see the files from Mozilla when using the 
chrome://jslib/content/... URL
- I have updated my local user.js file with the famous two lines that 
should get me priviledges to use XPConnect from local files, i.e.  

	user_pref("capability.principal.codebase.p0.granted", "UniversalXPConnect");
	user_pref("capability.principal.codebase.p0.id", "file:///"); 

And this is the action:
- I load a well-known local XUL file for testing purposes:

<?xml version="1.0"?>


        style="background-color: #cccccc; width: 100px; height: 100px;"

<script type="application/x-javascript" 
src="chrome://jslib/content/jslib.js" />;

<script type="application/x-javascript">
  include (jslib_file);
  // a local file path
  var localFile = "/tmp/fubar.dat";
  var f = new File(localFile);


<vbox flex="1" pack="center">
  <spacer flex="1" />
  <button label="Function List" oncommand="alert(f.help);" />
  <button label="exists" oncommand="alert(f.exists());" />
  <button label="create file" oncommand="if (!f.exists()) f.create();" />
  <spacer flex="1" />

and there is no Javascript effect. As confirmed by the debugger, the 
jslib files are not loaded as if priviledges were not granted.

I really do not understand what is wrong. Could you give me an inch?

Thanks in advance.

Jean-Yves MERTES.

More information about the Jslib mailing list