Skip to content

How can I track the window URL in a thread? #1335

Closed Answered by r0x0r
danjrichards asked this question in Q&A
Discussion options

You must be logged in to vote

I don't know what's wrong with your example, but a better approach would be to subscribe to window.events.loaded event to track url changes. For example

def main():
    global window
    window = webview.create_window('App behind OAuth', 'https://domain.com/login/sso')
    window.events.loaded += monitor_thread
    webview.start(private_mode=False, debug=True)


def monitor_thread():
    print(window.get_current_url())


if __name__ == "__main__":
    main()

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by danjrichards
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants