jchv/go-webview2

Eval in Asynchronous thread not work

kityun opened this issue · 1 comments

go func(){

...

callback(func(){
w.Eval(" alert('Hello from webview!'); ")
)
..

}

jchv commented

At least for now, Eval only works on the main thread. Using Dispatch should help. You'll have to do:

w.Dispatch(func() {
    w.Eval(" alert('Hello from webview!'); ")
})