MCPcopy Index your code
hub / github.com/inkeliz/gowebview

github.com/inkeliz/gowebview @v1.0.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.0.1 ↗ · + Follow
105 symbols 234 edges 13 files 44 documented · 42% 1 cross-repo links
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

gowebview

GoDoc Go Report Card

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.

Why use inkeliz/gowebview?

  • 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.

Getting started

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.

TODO

  1. ~~Add support to programmatically allow "locahost connections".~~

    ~~Currently you must run CheckNetIsolation.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.

  2. Improve support for Android (currently it needs Gio)

    Currently it's supported, but needs Gio to works.

  3. Remove dependency of webview.dll by calling WebView2Loader.dll directly.

    Currently, it needs to extract both .dll.

  4. Improve security by restricting where look for DLL.

    Currently gowebview adds a new filepath on %PATH%)

  5. Improve error returns.

    Currently it returns errors directly from os, windows and ioutil libraries.

License

Code is distributed under MIT license, feel free to use it in your proprietary projects as well.

Credits

It's highly based on webview/webview and webview/webview_csharp. The idea of avoid CGO was inspired by Ebiten.

Extension points exported contracts — how you extend this code

Core symbols most depended-on inside this repo

Shape

Method 54
Struct 23
Function 20
Class 3
FuncType 2
TypeAlias 2
Interface 1

Languages

Go87%
Java13%

Modules by API surface

gowebview_windows.go22 symbols
gowebview.go19 symbols
internal/wincom/com_windows.go18 symbols
gowebview_android.go15 symbols
gowebview_android.java14 symbols
internal/network/network_windows.go4 symbols
generator/generate.go4 symbols
gowebview_windows_test.go3 symbols
internal/network/network.go2 symbols
lib.go1 symbols
internal/network/network_windows_test.go1 symbols
internal/network/network_test.go1 symbols

Used by 1 indexed graphs manifest dependencies, hub-wide

For agents

$ claude mcp add gowebview \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page