4 ms·
This is fine, but if you want something that does all this, but also: * is header-only * supports EDGE on Windows without the need to have the WebView2 SDK or
by julesrms 2y ago
This is fine, but if you want something that does all this, but also:
* is header-only
* supports EDGE on Windows without the need to have the WebView2 SDK or to bundle a runtime DLL
* supports fetch intercepting and some other customisation
* is modern C++ rather than a sort of mashup of C/C++
then check out the one in the CHOC library here:
https://github.com/Tracktion/choc/blob/main/gui/choc_WebView.h https://github.com/Tracktion/choc/blob/main/gui/choc_WebView...
- saurik 2y agoThis library is also header-only (look at the source file).
- bun_terminator 2y agoInteresting! The header as well as the entire library. Thanks
- wild_pointer 2y agoFrom the readme: > Internally, some absolutely hideous shenanegans are involved to make this possible! Yeah, like literally embedding a dll in the header file. Pretty cool, but seems kinda fragile.
- leni536 2y agoC++ programmers will do anything to avoid using a proper package manager. I say this as a C++ programmer.
- actionfromafar 2y agoSeconded.
- whizzter 2y agowhich one? :P
- julesrms 2y agoIt's totally fair to criticise it for being a horrible, ugly technique. But in terms of fragility, it's no worse than bundling the same DLL as a file along with your app. (In fact, it's less fragile than a loose DLL, because you don't run the risk of your DLL failing to install/being moved/accidentally loading some other random version of the same DLL etc)
- rezaprima 2y agoso, a statically linked Dynamically Linked Library ?
- leni536 2y agoHey, isn't that what docker is for?
- jcelerier 2y agoYes, let's add a complete software stack instead of using the most basic CS101 linker feature
- kjksf 2y agoIn case you're not just riffing: no, it's not statically linked. The WebViewLoader.dll is embedded in the source code and then loaded into memory as if it was loaded via LoadLibrary() or by Windows .exe loader which loads referenced .dll automatically. Granted, he re-implemented LoadLibrary() to load from memory, which can potentially break if Microsoft changes the details of how LoadLibrary() is implemented. This is one of my pet peeves with Microsoft API design. LoadLibrary() only works with files from disk. It should be implemented as a trivial wrapper around LoadLibraryFromMemory() but Microsoft didn't implement LoadLibraryFromMemory so we have to resort to re-implementing LoadLibrary when we want this very useful functionality.
- rovingeye 2y agoI still don't see a reason to re-implement this functionality when you can just.. statically link the loader. CHOC is great though!
- rovingeye 2y agoYeah, it's kind of silly when the WebView2 loader can be statically linked. It's just build system avoidance. CHOC is great though!
- ninepoints 2y ago"header only" Aside from template based code, this is a disadvantage in my book usually
- deleted 2y ago[deleted]