| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
WebView2-for-Python is a pure Python binding to Microsoft Edge WebView2, a webview control for Windows 11 based on recent versions of Chrome/Chromium.
It can either be used in standalone mode or embedded into common GUI toolkits, simple wrappers are provided for the following toolkits:
Minimal code, standalone mode:
from webview2.standalone import *
webview = WebView2(url='https://www.google.com/')
webview.set_focus()
webview.run()For the API check out __init__.py and the various demos.
The standard way to initialize WebView2 is to use the WebView2Loader.dll that comes with Microsofts's WebView2 SDK. WebView2-for-Python instead uses a custom loader.dll. The reason for this is that this small loader.dll allows to use CreateCoreWebView2EnvironmentWithOptions() and pass an instance of CoreWebView2EnvironmentOptions to it, which requires WRL and therefor is hardly possible to implement in plain C or Python/ctypes/libffi code. In particular the loader.dll activates support of browser extensions in the used environment.
| Back | FazBrowse Home | New Git URL |