Fwd: Re: fun with new browsers (Was: doctypes in IE5/Mac)


  • None.


  • None.
sounds pretty cool...

----- Forwarded message from Matthew Wickline -----

Date: Fri, 7 Apr 2000 10:29:27 -0700 (PDT)
From: Matthew Wickline
To: Gerald Oskoboiny <gerald@w3.org>
Subject: Re: fun with new browsers (Was: doctypes in IE5/Mac)

Many moons ago, you mentioned on one of the hwg lists (I think) a cgi
script that you used to validate html syntax, do web searches, and other
stuff based on what you typed in a text field... "Do the Right Thing" I
think you called it.

   [ DTRT: http://impressive.net/services/dtrt/ -- g ]

I don't know if you still use that, but seeing yours inspired me to write
one of my own which I now use for maps, weather, many various searches,
HTML/XML/CSS validation, etc etc ad naseum. I use it in a little pop-up
console which just has that text input, and the form's target attribute is
set to "_blank" so that I can just type something in the console, hit
return, and get a new window with the goodies inside.

When NN6 came out, I wanted to be able to just use the browser's normal
location/address/netsite/whatever field to do this sort of thing, and I
thoght XUL might let me. If you still use DTRT on a regular basis, you
might be interested in this... If you don't use DTRT much anymore, this
may be less interesting.

First, open all.js
   Netscape Folder/defaults/pref/all.js

   pref("keyword.URL", "http://keyword.netscape.com/keyword/");
   pref("keyword.URL", "http://your.com/script.cgi?paramname=");

This will allow you to type commands to your script, and netscape will
pass them to your script instead of to it's "keywords" feature. Generally,
this means that anything with a space in it gets sent to your script. As I
recall, DTRT required :// as a delimiter between the "command" and the
"website argument". My version allows a space instead and looks at the
first word to determin the "command". If the first word is not recognized,
it assumes the whole string is search via my default search engine.

With a minor change to DTRT (as I recall it, anyhow), you will be able to
use it in place of NN keywords.

This will open results into the current window. If you might want to open
those results in a new window, you can create a button right next to
netscape's "search" button (or replace their search button).

First, open navigator.js
   Netscape Folder/chrome/navigator/content/default/navigator.js
and add a function (I inserted mine near OpenSearch)
   function MyOpenSearch(tabName, forceDialogFlag, searchStr)
       var mySearchURL = "http://your.com/script.cgi?paramname=";
       window.open( mySearchURL + searchStr);

Then open navigator.xul
   Netscape Folder/chrome/navigator/content/default/navigator.xul
and add a button...

Search for the button with id="search-button" class="toolbar-non-iconic"
and just duplicate the three lines making that button (assuming you're
making a new one). Change value="&searchButton.label;" to value="DTRT" (or
whatever), and id to "my-search-button" or something, and finally change
the onClick function call to MyOpenSearch rather than OpenSearch.

Now, you'll have a button when you want to open a new window with DTRT
results of whatever you typed in the location field. ... and when you
don't want a new window, just hit enter (provided your text is such that
NN's keywords feature would be triggered).

So, the above might require a minor change to DTRT (allowing spaces
instead of ://), but if you still find DTRT usefull, it will be
increasingly more usefull as NN6 shapes up!


PS: If you know others who might find this usefull, feel to pass it on.
However, I'm spamphobic, so would appreciate it if you could remove my
email address. Gracias :)

----- End forwarded message -----

Gerald Oskoboiny       <gerald@w3.org>  +1 617 253 2920
System Administrator   http://www.w3.org/People/Gerald/
World Wide Web Consortium (W3C)      http://www.w3.org/

HURL: fogo mailing list archives, maintained by Gerald Oskoboiny