Code: Select all
GetCookies(uri, handler) => ComCall(5, this, 'wstr', uri, 'ptr', handler) ; ICoreWebView2GetCookiesCompletedHandler
https://github.com/thqby/ahk2_lib/tree/master/WebView2
this is my simple script, I just want to grab the cookies within the webview, but Im unsure about "ptr", I see a corresponding number in debugger. Doesnt work,
Im just curious if anyone has a shortcut to grab cookies from edge webview2? or Neutron, Im not partial.
Code: Select all
#Include WebView2.ahk
main := Gui('+Resize')
main.OnEvent('Close', (*) => (wvc := wv := 0))
main.Show(Format('w{} h{}', A_ScreenWidth * 0.6, A_ScreenHeight * 0.6))
wvc := WebView2.create(main.Hwnd)
wv := wvc.CoreWebView2
wv.Navigate('https://bing.com/chat')
x := wvc.CookieList
GetCookiesHandler(cookie){
FileAppend(cookie, "txt.txt")
}
x.GetCookies(wv.ptr, GetCookiesHandler)
wv.AddHostObjectToScript('ahk', {str:'str from ahk',func:MsgBox})
wv.OpenDevToolsWindow()