search function needs better parsing

VERIFIED FIXED in mozilla0.9.1

Status

SeaMonkey
Search
P1
normal
VERIFIED FIXED
18 years ago
10 years ago

People

(Reporter: matt, Assigned: matt)

Tracking

Trunk
mozilla0.9.1
x86
Windows NT

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

18 years ago
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
(Assignee)

Updated

18 years ago
Keywords: nsbeta1+
Target Milestone: --- → mozilla0.9.1
making a P1. 
Priority: -- → P1
(Assignee)

Comment 2

18 years ago
Work almost done.  Need to clean up the code a little and then i'll post a 
patch.
(Assignee)

Comment 3

18 years ago
Created attachment 32899 [details] [diff] [review]
Regular expression for matching url
(Assignee)

Comment 4

18 years ago
Need reviews

Comment 5

18 years ago
get rid of the dump debug line, then r=mcafee

Comment 6

18 years ago
>     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

Comment 7

18 years ago
whoops. add a protocol to that last server, sorry about that.
(Assignee)

Comment 8

18 years ago
/(:\/\/|^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?

Comment 9

18 years ago
timeless mentioned there's a service for checking URL validity?
(Assignee)

Comment 10

18 years ago
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
(Assignee)

Comment 11

18 years ago
fixed
Status: NEW → RESOLVED
Last Resolved: 18 years ago
Resolution: --- → FIXED

Comment 12

18 years ago
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.