Add http when not present on browser

pull/324/head
Alexandre Van de Sande 10 years ago
parent 7aef0fed29
commit 05f2808849
  1. 7
      cmd/mist/assets/qml/views/browser.qml

@ -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…
Cancel
Save