mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-13 11:36:37 +00:00
Add http when not present on browser
This commit is contained in:
parent
7aef0fed29
commit
05f2808849
1 changed files with 6 additions and 1 deletions
|
|
@ -238,7 +238,12 @@ Rectangle {
|
||||||
z: 20
|
z: 20
|
||||||
activeFocusOnPress: true
|
activeFocusOnPress: true
|
||||||
Keys.onReturnPressed: {
|
Keys.onReturnPressed: {
|
||||||
webview.url = this.text;
|
// if there's no http, add it.
|
||||||
|
var url = this.text,
|
||||||
|
matches = url.match(/^([a-z]*\:\/\/)?([^\/.]+)(:?\/)(.*|$)/i),
|
||||||
|
requestedProtocol = (matches && matches[1] != "undefined")? "" : "http://";
|
||||||
|
|
||||||
|
webview.url = requestedProtocol + url;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue