Closed Bug 77261 Opened 23 years ago Closed 23 years ago

search function needs better parsing

Categories

(SeaMonkey :: Search, defect, P1)

x86
Windows NT
defect

Tracking

(Not tracked)

VERIFIED FIXED
mozilla0.9.1

People

(Reporter: matt, Assigned: matt)

Details

Attachments

(1 file)

Description:  When Search button is pushed, the browser should  select 
intelligently whether the data is a Search 
        or a URL
            Base part of behavior of Necko code parsing of URLs
            Need to constuct table :
                ://  = url
                about: = url
                4th character from the end of a word is a "."  = url  (.com, 
.edu, .org)  Won't work on edge case of .tv 
                ect.  Might have any word with a "." in it or ignore this case.
                Remember .mp3 case
Keywords: nsbeta1+
Target Milestone: --- → mozilla0.9.1
making a P1. 
Priority: -- → P1
Work almost done.  Need to clean up the code a little and then i'll post a 
patch.
Need reviews
get rid of the dump debug line, then r=mcafee
>     var urlSpacematch= /\S/ ;
Ok so you're looking for 1 non space character? WHY?
>     var urlmatch= /:\/\/|ftp\./;
>       dump("\nPattern match:  " + urlmatch + "\n");
>     var forceAsURL = 
(urlmatch.test(searchStr)&&urlmatch.test(urlSpacematch));
and you make sure that there is 1 non space character.

var urlSpacematch= /\s/ ;
//i'm looking for a space
var forceAsURL = (urlmatch.test(searchStr)&&!urlmatch.test(urlSpacematch));
//i'm sure i don't want one

i don't see how this handles
telnet:foo.bar
about:baz
data:text/html,<html>this is a test</html>
javascript:"this is valid"
c:\lpt1\lpt1
mailto:postmaster@localhost
www.mcps.k12.md.us

-for now, i'd propose discarding r=mcafee
whoops. add a protocol to that last server, sorry about that.
/(:\/\/|^ftp\.)[^ \t]+$/ 

Here is the regex expression that i'm going to us
Corrected for less regex.

SR=brendan

Him...doesn't handle telnet:
Could add
/(:\/\/|^ftp\.|^telnet)[^ \t]+$/ 
But if they type telnet:foo and hit search they might want to search on that.
telnet: enter should work in this case, I'm not sure it should resolve telnet: 
search button.  German?

timeless mentioned there's a service for checking URL validity?
right but we have different conditions on the seach button.
If someone types netscape.com and searchs they might want
to search on netscape.com
We just want to solve the sure cases where we are 95 percent
confident that they want to resolve the url like
://
www.foo.com is arguable but still i think it's a edge case.
The conclusion is that it's better to train them on the search button being a 
search button.

Remember enter works differently
fixed
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
marking VERIFIED Fixed with 2001050304 builds. The patch is in the search parsing is
better. File new bugs against specific failures that do no match the specificed behaviors
outlined at :
 http://mozilla.org/projects/ui/communicator/browser/search/
Status: RESOLVED → VERIFIED
Product: Core → SeaMonkey
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: