diff options
author | Alexandre Van de Sande <alex.vandesande@ethdev.com> | 2015-02-16 18:17:31 +0800 |
---|---|---|
committer | Alexandre Van de Sande <alex.vandesande@ethdev.com> | 2015-02-16 18:17:31 +0800 |
commit | 05f28088499fdc0105bb17cee9345a3483aa24f2 (patch) | |
tree | e028adacfcacfe9f0549d503e17eee161a68f81e /cmd | |
parent | 7aef0fed29ec9e0b7f65f12f242c75b39b652d47 (diff) | |
download | dexon-05f28088499fdc0105bb17cee9345a3483aa24f2.tar dexon-05f28088499fdc0105bb17cee9345a3483aa24f2.tar.gz dexon-05f28088499fdc0105bb17cee9345a3483aa24f2.tar.bz2 dexon-05f28088499fdc0105bb17cee9345a3483aa24f2.tar.lz dexon-05f28088499fdc0105bb17cee9345a3483aa24f2.tar.xz dexon-05f28088499fdc0105bb17cee9345a3483aa24f2.tar.zst dexon-05f28088499fdc0105bb17cee9345a3483aa24f2.zip |
Add http when not present on browser
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/mist/assets/qml/views/browser.qml | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/cmd/mist/assets/qml/views/browser.qml b/cmd/mist/assets/qml/views/browser.qml index ff3ff0f7f..a6f4e3d92 100644 --- a/cmd/mist/assets/qml/views/browser.qml +++ b/cmd/mist/assets/qml/views/browser.qml @@ -238,7 +238,12 @@ Rectangle { z: 20 activeFocusOnPress: true 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; } } |