summaryrefslogtreecommitdiff
path: root/browser.py
diff options
context:
space:
mode:
Diffstat (limited to 'browser.py')
-rwxr-xr-xbrowser.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/browser.py b/browser.py
index f6107e9..f5475ab 100755
--- a/browser.py
+++ b/browser.py
@@ -22,8 +22,9 @@ class GeminiPage(QtWebEngineCore.QWebEnginePage):
class GeminiSchemeHandler(QtWebEngineCore.QWebEngineUrlSchemeHandler):
def requestStarted(self, request):
- print(request.requestUrl().toString())
- gem = gemini.get(request.requestUrl().toString())
+ request_url = gemini.hack_url(request.requestUrl().toString())
+ print(request_url)
+ gem = gemini.get(request_url)
print(gem['status'], gem['meta'])
buf = QtCore.QBuffer(parent=request)
buf.open(QtCore.QIODevice.WriteOnly)
@@ -39,7 +40,8 @@ class GUrlBar(QtWidgets.QLineEdit):
QtWidgets.QLineEdit.__init__(self)
def setUrl(self, url):
- return self.setText(url.toDisplayString())
+ url = gemini.hack_url(url.toDisplayString())
+ return self.setText(url)
class GBrowser(QtWidgets.QMainWindow):