This demonstrates the bug in webview2 where the first page load does
not execute any of the w.Init()
Javascript.
It includes a workaround, where the first page load is detected and reloaded.
If the binding worked, fmt.Println("this is called only once")
would be called twice, once on the first page load and again on the second page load (the workaround).
- Clone this repository
GOOS=windows go build .
- Put
webview2-bug.exe
in your Windows machine - Open command line in Windows, run
webview2-bug.exe
Observe in the console:
this is called only once