Skip to content

Commit

Permalink
show web origin in window title
Browse files Browse the repository at this point in the history
I know it's a small detail, but I really like to see
where I'm inserting the SSO credentials
  • Loading branch information
mildsunrise committed Apr 19, 2024
1 parent 258f47c commit bbe2641
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions gp_saml_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand All @@ -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

Expand Down Expand Up @@ -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 = {}
Expand Down

0 comments on commit bbe2641

Please sign in to comment.