Friday October 06, 2006
An audience of two
Setting the default home page in Firefox
As I commented earlier, configuring the default homepage for Firefox turned out to be trickier than I thought it needed to be. So last night I took another crack at it. Now here are two easy ways to configure Firefox. One is to manually edit your .mozilla/firefox/rAnDoMcharacters/prefs.js file; the other, preferred method is to enter the URL about:config and configure it from the user interface. Looking at about:config I see an entry called browser.startup.homepage having the value resource:/browserconfig.properties. So logically it seems that I want to override the value of either of these. I checked the Mozilla Wiki and it confirmed that to change the default homepage the official method is:
browser.startup.homepage=http://en-US.start.mozilla.com/firefox?client=firefox-a&rls=org.mozilla:en-US:official
browser.startup.homepage_reset=http://en-US.start.mozilla.com/firefox?client=firefox-a&rls=org.mozilla:en-US:official
I began by trying to edit the file, but for some reason that didn't seem to do a damn thing. So then I went looking for where the browser.startup.homepage was set, and I found it in /opt/sfw/lib/firefox/defaults/pref/firefox.js. However once again, editing that didn't seem to work either. Next I found /opt/sfw/lib/firefox/defaults/profile/prefs.js. This file contains the same header file as the local prefs.js and looked very promising, so I tried editing the comment and started Firefox, but when I looked at the local prefs.js it had the default comment again. Very frustrating.
When I reached this point at CEC I started Yak shaving and ended up hacking the file /opt/sfw/lib/firefox/chrome/en-US.jar. But clearly that's far from optimal; there had to be a better way. So I ran truss on firefox to see what it was actually doing at startup time and I discovered that it actually writes the local prefs.js twice. It begins by copying the defaults/profile/prefs.js above, then adds some additional properties and then rewrites the file. So I simply added an entry that read
Now obviously this only sets the default; the user is free to overwrite that default using Edit/Preferences or about:config. If you wanted to lock that down it would be difficult; one way would be to create a wrapper script for Firefox that manually edited (or, if you wanted to be particularly antisocial, removed) the user's prefs.js; since Firefox is open source another option might be to compile your own version that always over-rode the default homepage setting. (You probably wouldn't need to rebuild the entire thing; just find the appropriate class and patch the jar file.) But since the user could bypass this by simply downloading a local copy of Firefox or another browser such as Opera, there seems very little point. Permalink
|
|
|
|
Comments [0]
Tags: |
Stinkin' Badges![]()
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| « October 2006 » | ||||||
| Mon | Tue | Wed | Thu | Fri | Sat | Sun |
|---|---|---|---|---|---|---|
7 | ||||||
9 | 11 | 12 | 13 | 14 | 15 | |
16 | 18 | 19 | 20 | 21 | 22 | |
23 | 24 | 25 | 26 | 28 | 29 | |
30 | 31 | |||||
| Today | ||||||
Today's Page Hits: 9