Repository navigation
webview2glue.dll exposes the following functions & has been compressed using upx with a minimal file size Visual Studio configuration:
typedef void(__cdecl *CallableVoid)();
/** adds a webview to the window associatedw with the provided hWnd */
extern "C" __declspec(dllexport) void CALLBACK createWebView(HWND hWnd, LPCWSTR url, CallableVoid loadingFinishedCb);
typedef void (__cdecl *CallableWstr)(LPCWSTR);
/** webview2 is capable of receiving messages sent from the frontend JS via a call that looks like window.chrome.webview.postMessage(`some cool message`); .
This function lets you register a callback taking the provided message as LPCWSTR or c_wchar_p as first and only parameter. */
extern "C" __declspec(dllexport) void __cdecl registerMessageCb(HWND hWnd, CallableWstr cb);
/** Ensures that the given JS will always have been executed once every time the page is updated*/
extern "C" __declspec(dllexport) void __cdecl addPermanentJavascript(HWND hWnd, LPCWSTR javascript);
extern "C" __declspec(dllexport) void __cdecl runJavascript(HWND hWnd, LPCWSTR javascript);
/** shorthand for the JS location.reload(); */
extern "C" __declspec(dllexport) void __cdecl reload(HWND hWnd);
extern "C" __declspec(dllexport) void CALLBACK setUrl(HWND hWnd, LPCWSTR url);
/** updates the size of the webview to match the size of the window associated with the provided hWnd if newBounds is nullptr. Otherwise we set the bounds to newBounds. */
extern "C" __declspec(dllexport) void CALLBACK updateWebviewBounds(HWND hWnd, RECT* newBounds);WebView2Loader.dll is a library that ships with Visual Studio and gets included in the builds of projects created using webview2. The copy I provide here has also been compressed using upx. To my knowledge, the code of this file is close sourced & maintained by the team reachable at https://github.com/MicrosoftEdge/WebView2Feedback .
windowWindowsImpl.py is a Python implementation making use of most of these functions and combining them with functionality from other dlls shipping with windows, like user32.