Add user-agent
This commit is contained in:
parent
00386298c6
commit
78f23db211
@ -1,2 +1,3 @@
|
||||
[default]
|
||||
home = https://example.com
|
||||
home = https://example.com
|
||||
useragent = BirdyNet/$VER ($OS)
|
@ -83,6 +83,7 @@ class browserWindow(QMainWindow):
|
||||
# additional info:
|
||||
"baseUrl": ""
|
||||
}
|
||||
self.cUserAgent = config["default"]["useragent"].replace("$OS",sys.platform).replace("$VER",versionString).replace("$DIST",distro)
|
||||
self.cCreateElements()
|
||||
|
||||
def cCreateElements(self):
|
||||
@ -119,7 +120,7 @@ class browserWindow(QMainWindow):
|
||||
def cNavigate(self,event = None):
|
||||
try:
|
||||
print(prettyJson(parseUrl(self.cUrlBar.text())))
|
||||
response = downloadPage(self.cUrlBar.text())
|
||||
response = downloadPage(self.cUrlBar.text(),{"User-Agent": self.cUserAgent})
|
||||
infoFetcher(response)
|
||||
self.cDocumentInfo = response
|
||||
self.cDoc.cRenderHtml(response["body"].decode("utf-8",errors="ignore"))
|
||||
|
Loading…
Reference in New Issue
Block a user