diff --git a/gp_saml_gui.py b/gp_saml_gui.py index f540a3b..99cdc02 100755 --- a/gp_saml_gui.py +++ b/gp_saml_gui.py @@ -28,7 +28,7 @@ from shlex import quote from sys import stderr, platform from binascii import a2b_base64, b2a_base64 -from urllib.parse import urlparse, urlencode +from urllib.parse import urlparse, urlencode, urlunsplit from html.parser import HTMLParser @@ -47,7 +47,7 @@ def handle_comment(self, data: str) -> None: class SAMLLoginView: def __init__(self, uri, html=None, verbose=False, cookies=None, verify=True, user_agent=None): Gtk.init(None) - window = Gtk.Window() + self.window = window = Gtk.Window() # API reference: https://lazka.github.io/pgi-docs/#WebKit2-4.0 @@ -128,6 +128,8 @@ def on_load_changed(self, webview, event): if self.verbose: print('[PAGE ] Finished loading page %s' % uri, file=stderr) + origin = urlunsplit(urlparse(uri)[:2] + ('',)*3) + self.window.set_title("SAML Login (%s)" % origin) # convert to normal dict d = {}