Closed av8ta closed 1 year ago
Oo, that's a great idea!
steps to take:
https://github.com/AgregoreWeb/agregore-browser/blob/master/app/ui/omni-box.js#L65
https://github.com/AgregoreWeb/agregore-browser/blob/master/app/ui/omni-box.js#L195
Inside the two blocks that use looksLikeDomain
add another check for isLocalhost()
which could be implemented just after this line
function isLocalhost(string) {
return string.startsWith('localhost')
}
Then have a makeHttp()
function around this line which could look like
function makeHttp(queryy) {
return `http://${query}`
}
So the code would look something like;
if(looksLikeDomain(whatever)) {
if(isLocalhost(whatever)) {
makeHttp(whatever)
} else {
makeHttps(whatever)
}
}
Fixed in #199 currently building the release for 1.4.1
Thanks @techie177 :)
The code to prepend http isn't running. I'll have a look at it.
Oh? I'm surprised it seemed to be working just fine when I had tested it directly in the latest version of the browser at the time
That's weird, it wasn't working for me. Added this part so that it builds the url and shows "Go to http://localhost..." https://github.com/AgregoreWeb/agregore-browser/blob/ce09498da3c12413fc7b57144eab10ead921a6b2/app/ui/omni-box.js#L196
Also changed the check to a regex because the startsWith check worked fine for localhost
but also for localhostanything
. Now it must be localhost
for port 80 or localhost:<some digits>
I still need to get the latest version of the browser installed but I just tried it now and it works just fine on version 1.4.0 . I went to duckduckgo's home page
When you type localhost
the idea is it goes to http://localhost
instead of searching duckduckgo
I still need to get the latest version of the browser installed but I just tried it now and it works just fine on version 1.4.0 . I went to duckduckgo's home page
Yes, that's correct if you want to search, but the feature of #189 is "Prepend http:// when localhost is in omnibox" :rofl:
When you type
localhost
the idea is it goes tohttp://localhost
instead of searching duckduckgo
oh I see what you mean, yeah that does make sense
Yep, it's all good now :)
To have the same behaviour as other browsers.