Skip to content

Commit b125f9b

Browse files
mildsunrisedlenski
authored andcommitted
show web origin in window title
I know it's a small detail, but I really like to see where I'm inserting the SSO credentials
1 parent 88027bb commit b125f9b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

gp_saml_gui.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
from shlex import quote
3636
from sys import stderr, platform
3737
from binascii import a2b_base64, b2a_base64
38-
from urllib.parse import urlparse, urlencode
38+
from urllib.parse import urlparse, urlencode, urlunsplit
3939
from html.parser import HTMLParser
4040

4141

@@ -55,7 +55,7 @@ class SAMLLoginView:
5555
def __init__(self, uri, html, args):
5656

5757
Gtk.init(None)
58-
window = Gtk.Window()
58+
self.window = window = Gtk.Window()
5959

6060
# API reference: https://lazka.github.io/pgi-docs/#WebKit2-4.0
6161

@@ -140,6 +140,8 @@ def on_load_changed(self, webview, event):
140140

141141
if self.verbose:
142142
print('[PAGE ] Finished loading page %s' % uri, file=stderr)
143+
origin = urlunsplit(urlparse(uri)[:2] + ('',)*3)
144+
self.window.set_title("SAML Login (%s)" % origin)
143145

144146
# if no response or no headers (for e.g. about:blank), skip checking this
145147
if not rs or not h:

0 commit comments

Comments
 (0)