diff src/browser/sat_browser/panels.py @ 612:5983d6be4f07 frontends_multi_profiles

browser side (web panel): schemes are now checked, if no scheme is given (or a not accepted one), http:// is used
author Goffi <goffi@goffi.org>
date Tue, 10 Feb 2015 19:38:28 +0100
parents a5019e62c3e9
children 70872a83ef15
line wrap: on
line diff
--- a/src/browser/sat_browser/panels.py	Tue Feb 10 19:13:25 2015 +0100
+++ b/src/browser/sat_browser/panels.py	Tue Feb 10 19:38:28 2015 +0100
@@ -480,7 +480,12 @@
         self.setWidget(self._vpanel)
 
     def onUrlClick(self, sender):
-        self._frame.setUrl(self._url.getText())
+        url = self._url.getText()
+        scheme_end = url.find(':')
+        scheme = "" if scheme_end == -1 else url[:scheme_end]
+        if scheme not in C.WEB_PANEL_SCHEMES:
+            url = "http://" + url
+        self._frame.setUrl(url)
 
 
 class MainPanel(AbsolutePanel):