Customising Netscape

Connecting to the internet and doing some “meaningful” browsing is what many of us like to do. However, decent browsing in Linux is still like searching for the Holy Grail. There are a few “development only” browsers like Mozilla, konquerer and Opera, while there are some others that have still not quite reached this stage.

So, like it or not, we have to do with Netscape “The Behemoth”, the browser that is NOT fast, stable, configurable or standards compliant. Still, there are a few things that you can do to make life with Netscape easier.

Many people know to use the command line arguments -bg and -fg to make Netscape look better with their installed themes. But there are a host of other options that you can tweak by editing the ~/.Xdefaults. I assume that you have Netscape installed on your Linux box. Netscape installs a app-defaults file called Netscape.ad. Find out where this file is installed and READ it THOROUGHLY. There are a lot of customisation options listed here, and all you have to do is copy some lines from this file into the ~/.Xdefaults. Among the things that you could do are change the user interface, build/setup macros, change the functionality of the mouse buttons, remap keys on the keyboard, rearrange or rename the user menus and a lot more.

Here are a few of the customisations that you could copy straight into the ~/.Xdefaults. The lines starting with a “!” are comments.

!##Netscape !The following line disables the blink tag that so many warped users use in their pages
Netscape*blinkingEnabled: False

!This removes the flash startup screen that shoots up at startup
Netscape*noAboutSplash: True

!This prevents errors being displayed in dialogs, and sends them instead to
!the console
Netscape*useStderrDialog: False
Netscape*useStdoutDialog: False

! ============================================================================
!Fonts in the widgets.
!These fonts are all down in Motif land, and thus are not controlled by the
!font selector on the Preferences dialog. That applies only to fonts in
!the document display area.
!============================================================================

!As you can see, I like nexus. Feel free to specify your own fonts here.
!You can use X font descriptions or aliases here.

!This is the default font for netscape widgets (menu text etc).
Netscape*fontList: nexus

!This is the font used for the location bar
Netscape*XmTextField.fontList: nexus

!Change these if you fancy. I haven’t bothered ;)
!Netscape*XmText.fontList: -adobe-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-*
!Netscape*XmList*fontList: -adobe-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-*
!Netscape*menuBar*historyTruncated.fontList:-*-helvetica-medium-o-*-*-*-120-*-*-*-*-iso8859-*
!Netscape*popup*fontList: -*-helvetica-medium-r-normal-*-*-120-*-*-*-*-iso8859-*
!Netscape*licenseDialog*text.fontList: -adobe-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-*

Push animations to the wilderness

If animations dancing gaudily on the browser irritate you, then this script is for you.

#!/bin/sh
KILLSTRINGS="-e s/NETSCAPE2.0/DISABLEDXXX/g\
-e s/ANIMEXTS1.0/DISABLEDXXX/g"
FILE=$1
if [ ! -f $FILE ]; then
echo 'killanim FILENAME'
exit 1
fi
if [ -f $FILE.orig]; then
echo 'Rename $FILE.orig to something else and run again'
exit 1;
fi
sed $KILLSTRINGS $FILE > $FILE.new &&
mv $FILE $FILE.orig &&
mv $FILE.new $FILE
chmod +x $FILE

Save this file as killanim. Make it executable with chmod +x killanim. Run it as “root”, as in
./killanim /usr/lib/netscape/netscape-communicator

In case you want to re-enable the animated stuff, the script has made a backup at /usr/lib/netscape.

Soothing fonts

Netscape for Linux is most infamous for its crazy font scaling. They are very small to start with. Then you goto :
Edit > Preferences > Appearance > Fonts, and set it to say size 18, and yet, the results are pathetic. The ugly scaled fonts do have a solution. Get the Mozilla fonts package at http://fox.mit.edu/skunk/xwin/#mozilla_fonts. Unpack the archive and read the included README file(s).

Create a new directory
mkdir /usr/X11R6/lib/X11/fonts/moz
Edit the Makefile to include this directory.

Become “root” on your system and run
make pcf
make install

Edit /etc/X11/fs/conf and add the new directory to the font paths.
Run xset fp+ /usr/X11/lib/X11/fonts/moz/.

Restart the browser. Go to the font choosing menu, select the Mozilla fonts, and a font size of something like 9 – 12 will be just fine.

Entering URLs

What do you do to enter URLs in the location bar?? Click on bar, then put cursor at the beginning, edit the characters and then enter. Now, we’ll make it simpler – simply type the address at the terminal and you are done. For this, read the script below:

#!/bin/sh

if killall -0 netscape 2>/dev/null
then
netscape -remote “openURL($1)”
else
netscape $1 &
fi

Save the script as a file(foo_urwish), make it executable and then put it in a directory in your $PATH. You are done!

To goto a particular webpage, open a terminal/Eterm, type the filename(foo_urwish) followed by the the URL. Netscape will now open the page for you. If you want to open a local file, just give the whole path.

Different Menu font

If your current menu fonts are so big that your bookmark submenus have become unusable, it is time to choose a different font. Add this to your ~/.Xdefaults file:

*fontList: -*-lucida-medium-r-*-*-12-*-*-*-*-*-*-*

Run xrdb -merge ~/.Xdefaults and restart the browser.

Trash useless toolbars

Have you used the “Shop”, “Security”, “Home” buttons lately? Chances are you never have and probably never will<g>.
Remove them. Add the following lines to your ~/.Xdefaults:

Netscape*toolBar.myshopping.isEnabled: false
Netscape*toolBar.destinations.isEnabled: false
Netscape*toolBar.search.isEnabled: false
Netscape*toolBar.viewSecurity.isEnabled: false
Netscape*toolBar.home.isEnabled: false

Netscape*toolBar.print.isEnabled: false

Run xrdb -merge ~/.Xdefaults and restart the browser.
Only the “Back”, “Forward”, “Reload” and “Stop” buttons are left – more than you will ever need.

A “Find in page” button in the toolbar

There are many times when you need to do a keyword search in a loaded page. This button makes it easier. Add these lines to your ~/.Xdefaults.

Netscape*toolBar.userCommand1.commandName: findInObject

Netscape*toolBar.userCommand1.labelString: Find
Netscape*toolBar.userCommand1.commandIcon: Search

Voila!! And there you have a new button.

External browser plugins

There are hardly any plugins for the Linux version of Netscape. One program that works as an external plugin is XSwallow.
Read about it at http://www.csn.ul.ie/~caolan/docs/Xswallow.html

Get the binaries for XSwallow and copy xswallow.conf to the ~/.netscape directory and the binary to ~/.netscape/plugins directory(after creating it). Edit
xswallow.conf and enter your favourite media players.

Start the browser and choose ‘About Plugins’ from the ‘Help’ menu. If everything has gone fine, XSwallow should now be listed here with the configured media types. Browse to the XSwallow home page and visit the plugin test pages to see if it works correctly. However, XSwallow does not work with Netscape 4.6x, it works fine with the 4.7x.

Another plugin called plugger is also available, and it can be used to view apecial document formats like .pdf and .tex
from within the browser. The concept of this plugin is very simple – it just gets the generic viewers that are available under X.

Customising your reply message from Messenger

The Netscape Messenger mail/news reader software can be made to contain your own string when you reply to a message.
For this, add this to your ~/.Xdefaults.

Netscape*strings.21928:%s proclaimed:<P>

When you reply to a message, it’ll start with the string :
Foo_sender proclaimed:

Now that you’ve gotten the hang of it, you can create your very own mail appendages right at the beginning<g>.

+++This one courtesy Thaths+++

Using altmail

Altmail, is a wrapper that allows Netscape to load most applications for mail and news reading. For this, you will need the Netscape-altmail tarball.

For example: to use pine to read email, compile altmail_pine.so and place it in the netscape directory, then add the following to ~/.netscape/preferences.js.

user_pref("mail.use_altmail", true);
user_pref("mail.altmail_dll","/opt/netscape/altmail_pine.so");

If you now click on a mailto: link, pine will come up in a terminal.

+++This was taken from the tuneup page at Linux.com+++

Keeping Netscape from crashing

I bet, sometime or the other, Netscape has crashed on your machine. Not much you can do about it then, but follow these general rules.

Check the logs and try to find out what happened. The least you can do is send a report to the Netscape developers(not that you’d be the first one reporting the bug, but it’ll help). The rule of thumb is to stay away from Netscape 4.xx, unless you have atleast 32 MB RAM. Even on a 64 MB system, Netscape is wobbly.

Download the Netscape binaries from Netscape or from one of the mirrors after a ftp search. Try to stay away from precompiled .deb and RPMs as much as possible, as they are compiled with some weird options. I have had n number of crashes and memory leaks with SuSE’s 4.72 as well as the Debian .deb.

Disable Java in the browser. You are much better off without it and a good site should not rely on Java anyway.

Upgrading Netscape to 128 bit security

So, Uncle Sam finally lifted the crytography laws, and Netscape 128 bit is now available for free download worldwide. For those who do not wish to download the huge binary again, there’s software to do the trick for you. Goto http://www.fortify.net to get the encyption suite for the browser. You only have to download a 450kB binary to make your browser secure. The URL where you can get their software when last checked was

http://www.fortify.net/cgi-bin/mirrorlist?version=Fortify-1.4.6-unix-x86.tar.gz<=English.

Untar the binary into a directory, ie tar xvf. Then close Netscape and change to the directory where you untarred the downloaded the binary. Become root on your system and type
./Fortify.sh /usr/lib/netscape/netscape-communicator. That's all.

And yes!! If you executed the script killanim to remove animations, you will have to redo the whole thing once again, otherwise the Fortified Netscape will not recognise what the script is telling it. Just reapply.

Start the browser. Open "Help" > "About Communicator". If all went well, you should be seeing the RSA key and a message that the browser supports US
security