Default browser under CDE/Solaris

How to set the default browser under CDE/Solaris with enhanced sdtwebclient

Intro

News

Setup

Developers

Developers

When looking at the source of sdtwebclient it should be pretty clear what has to be done to add support for other web browsers. This would be especially easy if the new browser uses the same remote control options as one of those that sdtwebclient already supports. You can send (tested) modifications by e-mail to martin@par.univie.ac.at and I'll include them.

Information about the supported remote control options can sometimes be retrieved with a browser's -h (help) command line option. There are web pages describing the remote control for Mozilla/Netscape 7.x, and netscape 4.x.

There is a variable named NETSCAPE_IS_VERSION_4 in sdtwebclient, which usually doesn't have to be changed. Background: If a binary named "netscape" is chosen to be the default browser, sdtwebclient will use "netscape -v" to get version info and to check if this is Netscape 4.x or Netscape 7.x (the two browsers use different options for remote controlling, and must be handled in different ways). This results in some overhead, as the browser has to be called twice - once for version checking, and then for the real run. One option is to set NETSCAPE_IS_VERSION_4 to tell sdtwebclient which netscape version the netscape binary actually is (see comments in sdtwebclient for possible settings). Another option is to name the netscape binary e.g. "netscape-4.8" or "netscape4" or "netscape7" - sdtwebclient will derive the netscape version from the file name then (symbolic links work, too).

Everything would be a lot easier if browser developers would make their applications just do the right thing. The browser should check for a running instance of itself. If it can't find one, just startup normally. If a URL has been supplied on the command line, open it; if not, open the default URL. If the browser is already running, open a new window or tab. Either load the supplied URL, or, if no URL has been given, open an empty window with the cursor in the URL entry field, or load the default startup page. opera nearly does it right (nearly, because there doesn't seem to be a way to open a new, empty tab in an already running instance of the browser).

sdtwebclient can also be run from the command line. You can use the -b browser option to select a browser to run, and you can supply a URL on the command line. sdtwebclient (both the original and the modified version) have a sleep 60 command at the very end of the script, so sdtwebclient won't return a command prompt immediately. The reason is that when e.g. double clicking on a .html file, the file will be saved to ~/.dt/tmp/ and then sdtwebclient will be run with the file name as parameter. When sdtwebclient exits, the temporary file is removed. As the browser is started in the background (&) in sdtwebclient and startup takes some time, the temporary file would be removed too early without the sleep command.

There is a difference between the new-tab and the new-window option to the openURL command in Firefox. If a URL is supplied, it works fine (a new window or tab is opened). If no URL is supplied, new-window will open a new empty window, but new-tab will do nothing. I think that's a bug in Firefox. In Mozilla and Netscape 7.0 new-tab without a URL will open a new empty tab, as expected.