A defacto "Netscape"


Forum: DSL Tips and Tricks
Topic: A defacto "Netscape"
started by: WDef

Posted by WDef on Nov. 03 2006,12:42
Unfortunately there are still programs out there that want to open netscape to access help urls etc. If their settings can't be easily pointed at firefox (probably usually can), they can instead be satisfied by doing the following.

As root:

1. cd /usr/local/bin; cp firefox netscape

2. Open /usr/local/bin/netscape with an editor.

3. Change line 81 from progname=$0 to progname="/usr/local/bin/firefox" and save.

There's now a defacto "netscape" on the system which opens as firefox.

Old programs looking for netscape (try old scite.dsl menu help->SCiTE help) will (hopefully) now be
happy and open firefox instead.

Obvious solutions failed: Doing alias netscape=firefox works for launching "netscape" from the
current shell but scite.dsl launched from that shell didn't see the alias (perhaps there's a way
around that (?)). A symlink to the firefox launch script won't work properly because of the way that the firefox launch scripts probe their paths and environment.  A wrapper for run-mozilla.sh with firefox-bin as an argument will launch firefox but we miss out on half of the probing.

Posted by ^thehatsrule^ on Nov. 03 2006,14:40
Quote
Doing alias netscape=firefox works for launching "netscape" from the
current shell but scite.dsl launched from that shell didn't see the alias (perhaps there's a way
around that (?)).
The easiest way for that is to put it in one of the startup scripts that set those vars.. i.e. profile so that the parent login shell would have it set.

Guess for the others would need their scripts to be changed/updated.

Why don't you try a wrapper for the wrapper? :P
That's what I usually do.

Posted by WDef on Nov. 03 2006,16:25
I thought there should be a way round it -  I'll try setting the alias in a parent shell - I have a vague suspicion it might not work though.

Re wrapper on wrapper -  when we get to layered wrapper-of-wrappers the counterfeit netscape perhaps seems easier ... it's only changing one line.

Posted by WDef on Nov. 03 2006,20:08
I remember now I tried this before - I set the alias in ~/.bashrc and it doesn't work for scite.dsl - the alias is there ok in user dsl's shells, but launching scite from a shell -> scite help ->error command netscape not found.

I think scite.dsl doesn't care what alias is set in the shell - I think its idea of where netscape is is set otherwise.

Posted by ^thehatsrule^ on Nov. 03 2006,23:31
hm, perhaps only shell scripts will see the aliases.

Anyways, here's something I would try for the wrapper... something along the lines of
Code Sample
#! /bin/sh
firefox "$@"

Of course make sure you chmod +x it

Posted by Johnnie Price on Nov. 04 2006,19:13
You know, you could simply download the auto-installer for Netscape 7.2 and then install it. ;)

Then again, I absolutely need Netscape for doing only one thing.  Annoying as all hell, but there you go.

Posted by WDef on Nov. 21 2006,15:45
I'm catching up on old posts.

No, I say *again*, wrappers on firefox itself will not work (and neither will symlinks)  - otherwise I wouldn't have bothered posting.  I do know how to write a wrapper btw. You obviously didn't try it. Please try reading my first post again.

Aliases won't work - scite doesn't look in PATH at all as far as I can tell. Some other apps do this sort of thing too eg Aespipe expects gnupg to be in one place and one place only for example - it's hard coded into its binary.

A wrapper on firefox-bin *will* work but it will not necessarily set the environment up for firefox as it's supposed to (as I implied).  Work through the way firefox launches.

If I wanted to install a redundant blob of netscape I would. The whole idea was not to, but instead to make a pseudo netscape available for any apps that want it, without having to hunt down how any particular app's browser is configured (if it even  is). This uses very little space and every app will find "netscape".

Posted by ^thehatsrule^ on Nov. 22 2006,16:29
lol... okay.  Here's my last crack then.

Most of the posts comes out of the top of my head at the moment.
The wrapper however is pretty generic, so I just wrote it out.

I'm guessing your DSL working environment is different from mine, as the symlink and wrapper - just tried - both worked off the bat. (DSL 1.5, ff 0.91) but alias did not. EDIT: just tried firefox 1.0.6, looks like the run-mozilla.sh script is changed so that using a symlink doesn't work here (tries to load $0-bin), but using a wrapper works still. (DSL 3.01, ff 1.06).  If you're using a different shell (ie /bin/sh) than default, maybe you need to either specify bash or use a script function to pass the params over correctly.

Re aliases: doesn't have to do with PATH, its shell specific.  And scite will look in PATH and pwd, since it executes 'netscape' as system sh command (would explain the alias not working).

Posted by roberts on Dec. 02 2006,03:24
WDef, thanks for the suggestion. Done. It wil be in 3.2.


Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.