Windows Webview without bundling `WebView2Loader`
Rather than relying on users to provide and bundle WebView2Loader.dll or statically link WebView2Loader.lib, a custom WV2 loader implementation can be embedded in webui.
An existing embedded Windows WV2 loader is referenced below:
https://github.com/webview/webview/blob/master/core/include/webview/detail/platform/windows/webview2/loader.hh
Yes, good idea, this will be helpful. We should try using loader.hh as it is, so we can get updates later.
Also, both projects are MIT licensed, so all good 👍
Yes, good idea, this will be helpful. We should try using loader.hh as it is, so we can get updates later.
Also, both projects are MIT licensed, so all good 👍
We shouldn't use loader.hh or other files from webview directly, as it requires a minimum C++11 compiler rather than building with pure C. It shouldn't be infeasible to add a custom C implementation and maintain it separately; any major improvements/fixes can still be shared between libraries.
I checked the file very quickly, and I did not even notice it's in C++ ! However, we can keep this in our to-do list, implementing it may take some time., but it's very good feature to have.
I have a small question. Currently, the function show_wv needs to be linked to the dynamic link library WebView2Loader.dll during compilation to work properly, right?
Yes, all xxx_wv() needs WebView2Loader.dll to be present in Windows, otherwise those functions will return false.
Replacing WebView2Loader.dll requires a lot of work... Manually implement the WebView2 COM interfaces, load runtime directly (WebView2.FixedVersionRuntime.xxx.x.x) and resolve its functions... Handle COM initialization and lifetime... and finally needs maintaining and bugs fix.
Probably user can simply use a DLL injector into compiled binary app.