[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[seul-edu] Update to Locking Mozilla/Phoenix/Firebird browser settings.



A few months ago, I sent lock-down instructions for mozilla/phoenix.
Here is an update which includes a few small details I had left out of
the original.  This also includes the line which you need to add to
all.js
to make the config work... and which I accidentally left out last
time.
(oops)

As far as I can tell this works under both Windows and Linux.  In 
testing, it has worked with all versions of mozilla since v1.1 and
also phoenix v0.5 and the firebird browser v0.6.

I am not sure which preferences you can lock, but I've tested nearly
all of the ones saved in prefs.js.   I know for sure that you can lock
proxy settings and homepage since those are what I initially tested
with.)

In my examples, I am going to use /usr/lib/mozilla-1.1 for the mozilla
install directory.  This was where Mozilla v1.1 was installed on Red
Hat
Linux v7.3.  This may not match your install dir.  You will have to
substitute your actual install directory if different.  Also, be aware
that
some distributions copy or link the mozilla program files into other 
directories such as /usr/bin (this is almost definitely NOT where you
want to be working.)  The real mozilla install directory should have
subdirectories named chrome, defaults and plugins (at least.)

* Install Mozilla/Phoenix/Firebird (referred to as Mozilla from here
on.)
* Run Mozilla as any user and configure the way you want
   (home page, proxy settings, etc.)
* Locate prefs.js. (In Linux it is under .mozilla/default/random.slt/ 
   (.phoenix/default/random.slt for phoenix/firebird) where random.slt

   could be named pretty much anything ending with .slt
   On my test machine it is: ~/.mozilla/default/0zhugsgz.slt/prefs.js
)
* Copy prefs.js to the mozilla install directory and rename it to
config.js 
   (ie: /usr/lib/mozilla-1.1/config.js  )
* Open config.js in your favorite text editor.
* Go through the file with a text editor and delete everything except
   the preferences you want to set or set-and-lock. 
   DON'T delete the first line.  (Actually I think anything can go
here
   including your own comment.  This line appears to be ignored.  The
   important thing to be aware of is that if you have a preference in
   the first line, it will be ignored.)
   Comments don't have to be removed, but they can if you wish.
* For every preference you want to lock, change user_pref to lockPref
* For every preference you want to just provide a default value for, 
   change user_pref to just pref - ie:
pref("some.config.item","somevalue");
   (When you are done, you should not have any lines starting with
user_pref)
* Save your updated file.
* Download moz-byteshift.pl from
   http://alain.knaff.lu/howto/MozillaCustomization/moz-byteshift.pl
* Encode the new preferences file with this command:
   perl moz-byteshift.pl -s 13 < config.js > mozilla.cfg
   (The new mozilla.cfg needs to be in the install directory
    for mozilla/phoenix/firebird.)
    For Mozilla 1.1 on RedHat 7.3 this was /usr/lib/mozilla-1.1/ )
* Add the following line to your mozilla/phoenix all.js file: 
   pref("general.config.filename", "mozilla.cfg");
   (This file can be found in defaults/pref under the install
directory. )
    ie.. for Mozilla 1.1 under RedHat 7.3, you should find it in 
    /usr/lib/mozilla-1.1/defaults/pref/all.js 
* You should be able to copy just the all.js and the mozilla.cfg
   files to the correct directories on other systems if you have
   mozilla installed on each PC.

Some important notes:
prefs.js and defaults - If a preference you want to lock is already
a default for mozilla, you may have to change it, quit mozilla, run
mozilla again, and change it back.  If you don't do this, mozilla
doesn't appear to write it out to prefs.js (which makes sense since
you never changed the preference.)

prefs.js and locking - It appears that starting with Firebird (v0.6)
mozilla
no longer saves preferences to prefs.js if they match those set in
your
.cfg file using the pref() option.  I had to disable it's use by
commenting
out the line in all.js.  Then these settings re-appeared in prefs.js.
Personally I consider not saving duplicate settings in prefs.js a
feature
and not a bug. 

The filenames you use really don't matter as long as you use the same
name in the all.js file as the file you create with moz-byteshift.pl.
Also, the command line I included for moz-byteshift.pl assumes it is
in the current directory.  If not you'll have to include the pathname
to it.

As a side note... if you have a netscape.cfg from the old 4.x Netscape
CCK,
you can unencode it with this command:
perl moz-byteshift -s -7 < netscape.cfg > netscape.js
This will let you see what settings were used for the 4.x config.

The one thing I still would like to figure out before deploying is how
to 
have a centralized config.  Under NS 4.x, the 
autoadmin.global_config_url setting allowed you to name a URL
that the browser would read it's configuration from.  I used a 
different URL for each school's custom NS setup.  This was nice
because you could change the proxy (or home page, etc.) for
everybody by updating a single file on your web server.

I've opened bug# 206294 on bugzilla.mozilla.org.  If you also
want this feature, I recommend going there, voting for this bug,
and possibly adding your e-mail address to the CC list so you
can track it's progress.

If anyone finds out how to get this to work on the current
Mozilla/phoenix/firebird browser, please let me know.  If I get a
working
solution, I'll forward it to the list.

Cory Jaeger
D.C. Everest Area School District
Weston, Wisconsin