Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#11726 closed bug (fixed)

Adding PORT to domain name causes WebPositive to do a Google search instead of load the web page

Reported by: codewrangler Owned by: pulkomandy
Priority: normal Milestone: R1
Component: Applications/WebPositive Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

Steps to Reproduce

  1. Boot hrev48639 of HaikuOS
  2. Launch Web Positive
  3. Type 'server.thursby.com:8080' into address bar and hit enter
  4. Notice that Web+ does a google search instead of recognizing it as a valid URL.

Attachments (1)

Screen Shot 2015-01-09 at 10.16.45 AM.png (196.7 KB ) - added by codewrangler 10 years ago.
Screenshot of issue

Download all attachments as: .zip

Change History (8)

by codewrangler, 10 years ago

Screenshot of issue

comment:1 by pulkomandy, 10 years ago

You can "force" it to work by adding a protocol: http://server.thursby.com:8080

comment:2 by codewrangler, 10 years ago

Yes, you can force it...However, you shouldn't have to. Web+ should have better logic to match the behavior of popular browsers like Safari, Chrome, Firefox and IE.

For example.... 'domain.com:8080' is a valid URL. As it's being typed into a 'browser' address bar, if it can't determine the protocol and it looks like a URL, it should try 'http://', since that's MOST likely what the user meant, since it's a Web browser.

Last edited 10 years ago by codewrangler (previous) (diff)

comment:3 by leavengood, 10 years ago

The code I originally wrote for this was very stupid, though it seems to have been improved a lot in subsequent years:

http://cgit.haiku-os.org/haiku/tree/src/apps/webpositive/BrowserWindow.cpp#n2465

We probably just need to create a new class to handle this and mimic Chrome's logic:

https://code.google.com/p/chromium/codesearch#chromium/src/components/omnibox/autocomplete_input.cc&l=132

The above is pretty complicated (and maybe more complicated than we need), but it is well commented.

Having some unit tests around it would be good probably.

This would be a great little piece of code for someone to contribute!

I would enjoy doing it but don't have the time.

comment:4 by leavengood, 10 years ago

Though having said all that, this particular specific bug of having a port number is probably easy enough to fix without going too crazy.

in reply to:  4 comment:5 by codewrangler, 10 years ago

Replying to leavengood:

Though having said all that, this particular specific bug of having a port number is probably easy enough to fix without going too crazy.

I would agree...

comment:6 by pulkomandy, 10 years ago

I mentionned the workaround only so you can access your website until this get fixed. Of course we need a proper fix.

The BUrl class has some rather good URL parsing now (and it has a test suite). Maybe we could make more use of it.

comment:7 by pulkomandy, 10 years ago

Resolution: fixed
Status: newclosed

Fixed in hrev48764.

Version 0, edited 10 years ago by pulkomandy (next)
Note: See TracTickets for help on using tickets.