Compare commits

...

2 Commits

Author SHA1 Message Date
Fierelier d98c61a028 Bump version 2021-03-20 21:14:22 +01:00
Fierelier 5abb9e13db Adding default protocol to URLs typed without one 2021-03-20 21:13:42 +01:00
2 changed files with 9 additions and 1 deletions

View File

@ -3,6 +3,8 @@
home = https://example.com
# User agent, used to identify your browser to a website
useragent = BirdyNet/$VER ($OS)
# Which protocol to use when none is given in the address bar
defaultProtocol = https
[accessibility]
# Which background color (CSS color) should be chosen for websites? "default" for system's default. "white" is recommended for compatibility.

View File

@ -34,7 +34,7 @@ os.chdir(sp)
distro = os.path.splitext(s.rsplit(os.path.sep)[-1])[0]
version = {
"major": 0,
"minor": 6,
"minor": 7,
"patch": 0,
"stage": "dev"
}
@ -164,6 +164,12 @@ class browserWindow(QMainWindow):
self.cTaskLock.acquire()
self.cDownloadId += 1
url = self.cUrlBar.text().replace(" ","%20") # dirty
urlParsed = parseUrl(url)
if urlParsed["protocol"] == "":
while len(url) > 0 and url[0] == "/":
url = url[1:]
url = config["default"]["defaultProtocol"]+ "://" +url
self.cUrlBar.setText(url)
threading.Thread(target=downloadPage, args=(self,self.cDownloadId,url,[("User-Agent",self.cUserAgent)])).start()
self.cTaskLock.release()
self.cDoc.setFocus()