Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

window methods do not work in 'loaded' event #528

bvukotic opened this issue May 25, 2020 · 2 comments

window methods do not work in 'loaded' event #528

bvukotic opened this issue May 25, 2020 · 2 comments


Copy link

@bvukotic bvukotic commented May 25, 2020


  • pywebview version: 3.2
  • platform / version: Windows 10


My code is:
def on_loaded():

window = webview.create_window('MyApp', "")
window.loaded += on_loaded

Problem is in[0].get_current_url()
it does not execute. It does not raise exception, it is just stuck there and nothing happens, method 'on_loaded' does not continue. Actually this also happens when I try to call:[0].evaluate_js('... some my javascript....')

I tried to use 'window' instead of[0] but result is the same

Copy link

@r0x0r r0x0r commented May 25, 2020

There were at least two issues.
a) callbacks were executed before the loaded event was set
b) callbacks were executed on the same thread, which resulted in hanging at least on macOS.

I have opened a PR. There might be side-effects of the logic change, so testing on different platforms and with different events is much appreciated.

Copy link

@bvukotic bvukotic commented May 26, 2020

I tried it on windows 10, didn't have any problems!

Great job!

@r0x0r r0x0r closed this as completed May 31, 2020
@r0x0r r0x0r mentioned this issue Jun 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

No branches or pull requests

2 participants