Netscape --remote (openURL) , anyone have a fix?

Netscape --remote (openURL) , anyone have a fix?

Post by etha » Mon, 30 Apr 2001 00:33:22



Does anyone know of a fix/workaround for the netscape --remove (openURL)
problem in KDE 2.1.1 ?  Will this be fixed in 2.1.2?
 
 
 

Netscape --remote (openURL) , anyone have a fix?

Post by D.L. Shar » Wed, 02 May 2001 22:32:27



> Does anyone know of a fix/workaround for the netscape --remove (openURL)
> problem in KDE 2.1.1 ?  Will this be fixed in 2.1.2?

Here's my workaround - It involves a tweak to the perl script
netscape-remote, and a new script, get-ns-id:

netscape-remote:

#!/usr/bin/perl

######################################################################
# The purpose of this script is to handle URL requests for Netscape. #
# If Netscape is already running, it will issue a netscape -remote   #
# command to launch the URL in the already opened browser.           #
# If Netscape is not already running it starts it with the specified #
# URL.                                                               #
#                                                                    #
# Unfortunately this script fails if Netscape dies and leaves behind #
# a stale lockfile. You'll have to start Netscape manually the next  #
# time if that happens.                                              #
######################################################################

my $url;

if ($ARGV[0] =~ /http/) { $url = $ARGV[0] }
elsif ($ARGV[1] =~ /http/) { $url = $ARGV[1] }

if (-l "$ENV{'HOME'}/.netscape/lock") {
  $NS_ID = `/usr/local/bin/get-ns-id`;
  exec ("/usr/local/netscape/netscape -id $NS_ID -remote 'openURL($url)'");

Quote:}

else {
        exec ("/usr/local/netscape/netscape $url");

Quote:}

-------------------------cut here-------------------

get-ns-id:

#!/bin/tcsh
setenv WINID_LIST `xwininfo -root -all | grep Navigator | awk '{print $1}'`
setenv NS_WIN_ID `echo $WINID_LIST | awk '{print $1}'`
echo -n $NS_WIN_ID

--------------------------cut here--------------------

This workaround works for me in both Redhat Linux 7.1 and Solaris 8.
You may need to tweak the paths a bit in your system to get it to work.

 
 
 

Netscape --remote (openURL) , anyone have a fix?

Post by David Turle » Thu, 03 May 2001 01:03:37


Where is this netscape-remote scriptlocated on yoru system? i can't seem
tof ind it on mine.


>> Does anyone know of a fix/workaround for the netscape --remove (openURL)
>> problem in KDE 2.1.1 ?  Will this be fixed in 2.1.2?

> Here's my workaround - It involves a tweak to the perl script
> netscape-remote, and a new script, get-ns-id:

> netscape-remote:

> #!/usr/bin/perl

> ######################################################################
> # The purpose of this script is to handle URL requests for Netscape. #
> # If Netscape is already running, it will issue a netscape -remote   #
> # command to launch the URL in the already opened browser.           #
> # If Netscape is not already running it starts it with the specified #
> # URL.                                                               #
> #                                                                    #
> # Unfortunately this script fails if Netscape dies and leaves behind #
> # a stale lockfile. You'll have to start Netscape manually the next  #
> # time if that happens.                                              #
> ######################################################################

> my $url;

> if ($ARGV[0] =~ /http/) { $url = $ARGV[0] }
> elsif ($ARGV[1] =~ /http/) { $url = $ARGV[1] }

> if (-l "$ENV{'HOME'}/.netscape/lock") {
>   $NS_ID = `/usr/local/bin/get-ns-id`;
>   exec ("/usr/local/netscape/netscape -id $NS_ID -remote
>   'openURL($url)'");
> }
> else {
>         exec ("/usr/local/netscape/netscape $url");
> }

> -------------------------cut here-------------------

> get-ns-id:

> #!/bin/tcsh
> setenv WINID_LIST `xwininfo -root -all | grep Navigator | awk '{print
> $1}'` setenv NS_WIN_ID `echo $WINID_LIST | awk '{print $1}'`
> echo -n $NS_WIN_ID

> --------------------------cut here--------------------

> This workaround works for me in both Redhat Linux 7.1 and Solaris 8.
> You may need to tweak the paths a bit in your system to get it to work.

 
 
 

Netscape --remote (openURL) , anyone have a fix?

Post by D.L. Shar » Thu, 03 May 2001 02:08:53



> Where is this netscape-remote scriptlocated on yoru system? i can't seem
> tof ind it on mine.

You can put the netscape-remote script anywhere on your system you want.
Mine is in /usr/local/bin.  This script is not a part of KDE or netscape.
You can simply cut and paste it from my original followup to this thread.


>>> Does anyone know of a fix/workaround for the netscape --remove (openURL)
>>> problem in KDE 2.1.1 ?  Will this be fixed in 2.1.2?

>> Here's my workaround - It involves a tweak to the perl script
>> netscape-remote, and a new script, get-ns-id:

>> netscape-remote:

>> #!/usr/bin/perl

>> ######################################################################
>> # The purpose of this script is to handle URL requests for Netscape. #
>> # If Netscape is already running, it will issue a netscape -remote   #
>> # command to launch the URL in the already opened browser.           #
>> # If Netscape is not already running it starts it with the specified #
>> # URL.                                                               #
>> #                                                                    #
>> # Unfortunately this script fails if Netscape dies and leaves behind #
>> # a stale lockfile. You'll have to start Netscape manually the next  #
>> # time if that happens.                                              #
>> ######################################################################

>> my $url;

>> if ($ARGV[0] =~ /http/) { $url = $ARGV[0] }
>> elsif ($ARGV[1] =~ /http/) { $url = $ARGV[1] }

>> if (-l "$ENV{'HOME'}/.netscape/lock") {
>>   $NS_ID = `/usr/local/bin/get-ns-id`;
>>   exec ("/usr/local/netscape/netscape -id $NS_ID -remote
>>   'openURL($url)'");
>> }
>> else {
>>         exec ("/usr/local/netscape/netscape $url");
>> }

>> -------------------------cut here-------------------

>> get-ns-id:

>> #!/bin/tcsh
>> setenv WINID_LIST `xwininfo -root -all | grep Navigator | awk '{print
>> $1}'` setenv NS_WIN_ID `echo $WINID_LIST | awk '{print $1}'`
>> echo -n $NS_WIN_ID

>> --------------------------cut here--------------------

>> This workaround works for me in both Redhat Linux 7.1 and Solaris 8.
>> You may need to tweak the paths a bit in your system to get it to work.

 
 
 

Netscape --remote (openURL) , anyone have a fix?

Post by David Turle » Thu, 03 May 2001 01:59:15


Thanks. Got it working. I didn't realize how much Imissed this feature. ;-)

> You can put the netscape-remote script anywhere on your system you want.
> Mine is in /usr/local/bin.  This script is not a part of KDE or netscape.
> You can simply cut and paste it from my original followup to this thread.

 
 
 

Netscape --remote (openURL) , anyone have a fix?

Post by Andrew Jaff » Thu, 17 May 2001 09:13:44


Hi all-


> Does anyone know of a fix/workaround for the netscape --remote (openURL)
> problem in KDE 2.1.1 ?  Will this be fixed in 2.1.2?

What is the status of this? Is there a fix? I saw some scripts posted,
but I couldn't get them to work. Any further help is much appreciated!

Andrew

--
----------------------------------------------------------------------

Department of Astronomy                                 (510) 642-7570
University of California, 601 Campbell Hall              FAX    2-3411
Berkeley, CA 94720

 
 
 

Netscape --remote (openURL) , anyone have a fix?

Post by Claus Tonderin » Tue, 29 May 2001 17:23:49


I tried the scripts below, and they sometimes work. But sometimes I
get this message:


PID 27349 doesn't exist on my PC. What's the problem?

--
Claus Tondering



> > Does anyone know of a fix/workaround for the netscape --remove (openURL)
> > problem in KDE 2.1.1 ?  Will this be fixed in 2.1.2?

> Here's my workaround - It involves a tweak to the perl script
> netscape-remote, and a new script, get-ns-id:

> netscape-remote:

> #!/usr/bin/perl

> ######################################################################
> # The purpose of this script is to handle URL requests for Netscape. #
> # If Netscape is already running, it will issue a netscape -remote   #
> # command to launch the URL in the already opened browser.           #
> # If Netscape is not already running it starts it with the specified #
> # URL.                                                               #
> #                                                                    #
> # Unfortunately this script fails if Netscape dies and leaves behind #
> # a stale lockfile. You'll have to start Netscape manually the next  #
> # time if that happens.                                              #
> ######################################################################

> my $url;

> if ($ARGV[0] =~ /http/) { $url = $ARGV[0] }
> elsif ($ARGV[1] =~ /http/) { $url = $ARGV[1] }

> if (-l "$ENV{'HOME'}/.netscape/lock") {
>   $NS_ID = `/usr/local/bin/get-ns-id`;
>   exec ("/usr/local/netscape/netscape -id $NS_ID -remote 'openURL($url)'");
> }
> else {
>         exec ("/usr/local/netscape/netscape $url");
> }

> -------------------------cut here-------------------

> get-ns-id:

> #!/bin/tcsh
> setenv WINID_LIST `xwininfo -root -all | grep Navigator | awk '{print $1}'`
> setenv NS_WIN_ID `echo $WINID_LIST | awk '{print $1}'`
> echo -n $NS_WIN_ID

> --------------------------cut here--------------------

> This workaround works for me in both Redhat Linux 7.1 and Solaris 8.
> You may need to tweak the paths a bit in your system to get it to work.

 
 
 

Netscape --remote (openURL) , anyone have a fix?

Post by Claus Tonderin » Tue, 29 May 2001 17:30:58



> I tried the scripts below, and they sometimes work. But sometimes I
> get this message:


> PID 27349 doesn't exist on my PC. What's the problem?

> --
> Claus Tondering

I discovered that the problem occured because "xwininfo -root -all"
sometimes lists windows that be long to dead Netscapes. Now, why is
that?

--
Claus Tondering