A small WebView without CGO, based on webview/webview. The main goal was to avoid CGO and make it possible to embed the DLLs. Instead of relying directly on CGO as webview/webview, the inkeliz/gowebview uses
golang.org/x/sys/windows
, for Windows.
- If you like to avoid CGO on Windows.
- If you like to have a single
.exe
.
Why use webview/webview?
- If you need support for Darwin/Linux.
- If you need binds from Javascript to Golang.
- If you like to use a more battle-tested and stable library.
Import the package and start using it:
package main
import "github.com/inkeliz/gowebview"
func main() {
w, err := gowebview.New(&gowebview.Config{URL: "https://google.com", WindowConfig: &gowebview.WindowConfig{Title: "Hello World"}})
if err != nil {
panic(err)
}
defer w.Destroy()
w.Run()
}
It will open the https://google.com
webpage, without any additional setup.
-
Add support to programmatically allow "locahost connections".Currently you must runCheckNetIsolation.exe LoopbackExempt -a -n="Microsoft.Win32WebViewHost_cw5n1h2txyewy"
externally.DONE. It's now implemented for Windows, if you use
Config.TransportConfig{IgnoreNetworkIsolation: true}
. You don't need to execute the sofware as admin, it'll be request only when needed. -
Improve support for Android (currently it needs Gio)
Currently it's supported, but needs Gio to works.
-
Remove dependency of
webview.dll
by callingWebView2Loader.dll
directly.Currently, it needs to extract both
.dll
. -
Improve security by restricting where look for DLL.
Currently gowebview adds a new filepath on %PATH%)
-
Improve error returns.
Currently it returns errors directly from
os
,windows
andioutil
libraries.
Code is distributed under MIT license, feel free to use it in your proprietary projects as well.
It's highly based on webview/webview and webview/webview_csharp. The idea of avoid CGO was inspired by Ebiten.