Tiny cross-platform webview library for C/C++/Golang. Uses WebKit (Gtk/Cocoa) and Edge (Windows)

Overview

webview

Join the chat at https://gitter.im/zserge/webview Build Status GoDoc Go Report Card

A tiny cross-platform webview library for C/C++/Golang to build modern cross-platform GUIs. Also, there are Rust bindings, Python bindings, Nim bindings, Haskell, C# bindings and Java bindings available.

The goal of the project is to create a common HTML5 UI abstraction layer for the most widely used platforms.

It supports two-way JavaScript bindings (to call JavaScript from C/C++/Go and to call C/C++/Go from JavaScript).

It uses Cocoa/WebKit on macOS, gtk-webkit2 on Linux and Edge on Windows 10.

Webview for Go developers

If you are interested in writing Webview apps in C/C++, skip to the next section.

Getting started

Install Webview library with go get:

$ go get github.com/webview/webview

Import the package and start using it:

package main

import "github.com/webview/webview"

func main() {
	debug := true
	w := webview.New(debug)
	defer w.Destroy()
	w.SetTitle("Minimal webview example")
	w.SetSize(800, 600, webview.HintNone)
	w.Navigate("https://en.m.wikipedia.org/wiki/Main_Page")
	w.Run()
}

To build the app use the following commands:

# Linux
$ go build -o webview-example && ./webview-example

# MacOS uses app bundles for GUI apps
$ mkdir -p example.app/Contents/MacOS
$ go build -o example.app/Contents/MacOS/example
$ open example.app # Or click on the app in Finder

# Windows requires special linker flags for GUI apps.
# It's also recommended to use TDM-GCC-64 compiler for CGo.
# http://tdm-gcc.tdragon.net/download
$ go build -ldflags="-H windowsgui" -o webview-example.exe

For more details see godoc.

Distributing webview apps

On Linux you get a standalone executable. It will depend on GTK3 and GtkWebkit2, so if you distribute your app in DEB or RPM format include those dependencies. An application icon can be specified by providing a .desktop file.

On MacOS you are likely to ship an app bundle. Make the following directory structure and just zip it:

example.app
└── Contents
    ├── Info.plist
    ├── MacOS
    |   └── example
    └── Resources
        └── example.icns

Here, Info.plist is a property list file and *.icns is a special icon format. You may convert PNG to icns online.

On Windows you probably would like to have a custom icon for your executable. It can be done by providing a resource file, compiling it and linking with it. Typically, windres utility is used to compile resources. Also, on Windows, webview.dll and WebView2Loader.dll must be placed into the same directory with your app executable.

Also, if you want to cross-compile your webview app - use xgo.

Migrating from v0.1.1 to v0.10.0

  1. webview.Open() has been removed. Use other webview APIs to create a window, open a link and run main UI loop.
  2. webview.Debug() and webview.Debugf() have been removed. Use your favorite logging library to debug webview apps.
  3. webview.Settings struct has been removed. Title, URL and size are controlled via other API setters and can be updated at any time, not only when webview is created.
  4. Webview.Loop() has been removed. Use Run() instead.
  5. WebView.Run(), WebView.Terminate(), WebView.SetTitle(), WebView.Dispatch() stayed the same.
  6. WebView.Exit() has been renamed to WebView.Destroy()
  7. WebView.SetColor() and WebView.SetFullScreen() have been removed. Use Window() to get native window handle and probably write some Cgo code to adjust native window to your taste.
  8. webview.Dialog has been removed. But it is likely to be brought back as a standalone module.
  9. WebView.Eval() remained the same.
  10. WebView.InjectCSS() has been removed. Use eval to inject style tag with CSS inside.
  11. WebView.Bind() kept the name, but changed the semantics. Only functions can be bound. Not the structs, like in Lorca.

Webview for C/C++ developers

Download webview.h and include it in your C/C++ code:

C++:

// main.cc
#include "webview.h"
#ifdef WIN32
int WINAPI WinMain(HINSTANCE hInt, HINSTANCE hPrevInst, LPSTR lpCmdLine,
                   int nCmdShow) {
#else
int main() {
#endif
  webview::webview w(true, nullptr);
  w.set_title("Minimal example");
  w.set_size(480, 320, WEBVIEW_HINT_NONE);
  w.navigate("https://en.m.wikipedia.org/wiki/Main_Page");
  w.run();
  return 0;
}

Build it:

# Linux
$ c++ main.cc `pkg-config --cflags --libs gtk+-3.0 webkit2gtk-4.0` -o webview-example
# MacOS
$ c++ main.cc -std=c++11 -framework WebKit -o webview-example
# Windows (x64)
$ c++ main.cc -mwindows -L./dll/x64 -lwebview -lWebView2Loader -o webview-example.exe

C:

// main .c
#include "webview.h"
#ifdef WIN32
int WINAPI WinMain(HINSTANCE hInt, HINSTANCE hPrevInst, LPSTR lpCmdLine,
                   int nCmdShow) {
#else
int main() {
#endif
	webview_t w = webview_create(0, NULL);
	webview_set_title(w, "Webview Example");
	webview_set_size(w, 480, 320, WEBVIEW_HINT_NONE);
	webview_navigate(w, "https://en.m.wikipedia.org/wiki/Main_Page");
	webview_run(w);
	webview_destroy(w);
	return 0;
}

Build it:

# Linux
$ g++ main.c `pkg-config --cflags --libs gtk+-3.0 webkit2gtk-4.0` -o webview-example
# MacOS
$ g++ main.c -std=c++11 -framework WebKit -o webview-example
# Windows (x64)
$ g++ main.c -mwindows -L./dll/x64 -lwebview -lWebView2Loader -o webview-example.exe

On Windows it is possible to use webview library directly when compiling with cl.exe, but WebView2Loader.dll is still required. To use MinGW you may dynamically link prebuilt webview.dll (this approach is used in Cgo bindings).

Full C/C++ API is described at the top of the webview.h file.

Migrating from v0.1.1 to v0.10.0

  1. Use opaque webview_t type instead of struct webview. Size, title and URL are controlled via API setter functions. Invoke callback has been replaced with webview_bind() and webview_return() to make native function bindings inter-operate with JS.
  2. If you have been using simplified webview() API to only open a single URL in a webview window - this function has been removed. You now have to create a new webview instance, configure and run it explicitly.
  3. webview_init() is replaced by webview_create() which creates a new webview instance.
  4. webview_exit() has been replaced with more meaningful webview_destroy().
  5. Main UI loop with webview_loop() inside has been replaced with webview_run() runs infinitely until the webview window is closed.
  6. webview_terminate() remains the same.
  7. webview_dispatch() remains the same.
  8. webview_set_title() remains the same.
  9. webview_set_color() has been removed. Use webview_get_window and native window APIs to control colors, transparency and other native window properties. At some point these APIs might be brought back.
  10. webview_set_fullscreen() has been removed, see above.
  11. webview_dialog() has been removed. But I'd like to see it added back as a separate independent module or library.
  12. webview_eval() remains the same.
  13. webview_inject_css() has been removed. Use webview_eval() to create style tag manually.
  14. webview_debug() has been removed. Use whatever fits best to your programming language and environment to debug your GUI apps.

Notes

Execution on OpenBSD requires wxallowed mount(8) option. For Ubuntu Users run sudo apt install webkit2gtk-4.0(Try with webkit2gtk-4.0-dev if webkit2gtk-4.0 is not found) to install webkit2gtk-4.0 related items. FreeBSD is also supported, to install webkit2 run pkg install webkit2-gtk3.

License

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

Comments
  • Setting the Window Icon?

    Setting the Window Icon?

    Is there a way to set the window icon on Windows yet? i.e. the top left corner of the Webview window?

    Using Go 1.18.3 on Windows 11. But will need it for MacOS and Linux too.

    Thanks

    opened by precisionpete 45
  • Use Windows.UI.Xaml.Controls.WebView where possible on Windows

    Use Windows.UI.Xaml.Controls.WebView where possible on Windows

    There are plenty of serious reasons to prefer EdgeHTML to MSHTML; Edge is a more modern target than IE, with various features that you can’t get on IE.

    In Universal Windows Apps, Windows.UI.Xaml.Controls.WebView uses IE11 on Windows 8 and Edge on Windows 10.

    I don’t know how you would go about doing it and I’m not certain it’s possible to do both in the one binary (though I imagine it is), but the ideal situation is to try to use the UWP WebView where possible, before falling back to the old MSHTML.

    I expect this would require using some C++/CX.

    I expect that implementing this will involve quite a bit of research and development, but it should be possible and is very desirable.

    opened by chris-morgan 29
  • Added icon switching demo for Windows & Linux

    Added icon switching demo for Windows & Linux

    Added a simple demo of changing the webview icon at runtime for Windows, as discussed in #686

    Ideally, would be great to see this expanded with working examples for Linux and MacOS.

    Discussion points:

    • syso files need to be generated with https://github.com/tc-hib/go-winres. Should they be included in the demo, or just explained in main.go?
    • The DLL files in https://github.com/webview/webview/tree/master/dll leads to an immediate crash. #658 #632 The DLL files in https://github.com/webview/webview_csharp/tree/master/libs do appear to work in my limited testing.

    Let me know if I can futher assist.

    help wanted 
    opened by ldstein 22
  • Can't compile example with golang.

    Can't compile example with golang.

    What OS are you using (uname -a, or Windows version)?

    Windows 10 Pro 1903(18362.657)

    What programming language are you using (C/C++/Go/Rust)?

    Go:

    go version go1.14 windows/amd64

    Gcc:

    Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=C:/TDM-GCC-64/bin/../libexec/gcc/x86_64-w64-mingw32/5.1.0/lto-wrapper.exe Target: x86_64-w64-mingw32 Configured with: ../../../src/gcc-5.1.0/configure --build=x86_64-w64-mingw32 --enable-targets=all --enable-languages=ada,c,c++,fortran,lto,objc,obj-c++ --enable-libgomp --enable-lto --enable-graphite --enable-cxx-flags=-DWINPTHREAD_STATIC --disable-build-with-cxx --disable-build-poststage1-with-cxx --enable-libstdcxx-debug --enable-threads=posix --enable-version-specific-runtime-libs --enable-fully-dynamic-string --enable-libstdcxx-threads --enable-libstdcxx-time --with-gnu-ld --disable-werror --disable-nls --disable-win32-registry --prefix=/mingw64tdm --with-local-prefix=/mingw64tdm --with-pkgversion=tdm64-1 --with-bugurl=http://tdm-gcc.tdragon.net/bugs Thread model: posix gcc version 5.1.0 (tdm64-1)

    What did you expect to see and what you saw instead?

    Hello, i can't compile example with go. Some errors occured:

    go build -ldflags="-H windowsgui" -o webview-example.exe

    # github.com/zserge/webview C:\Users\BEZRAZ~1\AppData\Local\Temp\go-build996545186\b002\_x002.o: In functionCgoWebViewBind': C:/Users/bezrazli4n0/go/src/github.com/zserge/webview/webview.go:41: undefined reference to webview_bind' C:\Users\BEZRAZ~1\AppData\Local\Temp\go-build996545186\b002\_x002.o: In function_cgo_513c5b174c28_Cfunc_webview_return': /tmp/go-build/cgo-gcc-prolog:181: undefined reference to webview_return' collect2.exe: error: ld returned 1 exit status

    opened by bezrazli4n0 22
  • Go: Failed to compile with mingw

    Go: Failed to compile with mingw

    What OS are you using (uname -a, or Windows version)?

    windows 10

    What programming language are you using (C/C++/Go/Rust)?

    Go

    What did you expect to see and what you saw instead?

    When I run go get -u "github.com/webview/webview", it shows me following:

    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/lib/libmingwthrd.a when searching for -lmingwthrd
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/lib\libmingwthrd.a when searching for -lmingwthrd
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/lib/libmingwthrd.a when searching for -lmingwthrd
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lmingwthrd
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/lib/libmingw32.a when searching for -lmingw32
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/lib\libmingw32.a when searching for -lmingw32
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/lib/libmingw32.a when searching for -lmingw32
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lmingw32
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/libgcc.a when searching for -lgcc
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0\libgcc.a when searching for -lgcc
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/libgcc.a when searching for -lgcc
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lgcc
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/libgcc_eh.a when searching for -lgcc_eh
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0\libgcc_eh.a when searching for -lgcc_eh
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/libgcc_eh.a when searching for -lgcc_eh
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lgcc_eh
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/lib/libmoldname.a when searching for -lmoldname
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/lib\libmoldname.a when searching for -lmoldname
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/lib/libmoldname.a when searching for -lmoldname
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lmoldname
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/lib/libmingwex.a when searching for -lmingwex
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/lib\libmingwex.a when searching for -lmingwex
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/lib/libmingwex.a when searching for -lmingwex
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lmingwex
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/lib/libmsvcrt.a when searching for -lmsvcrt
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/lib\libmsvcrt.a when searching for -lmsvcrt
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/lib/libmsvcrt.a when searching for -lmsvcrt
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lmsvcrt
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/lib/libpthread.dll.a when searching for -lpthread
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/lib/libpthread.a when searching for -lpthread
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/lib\libpthread.a when searching for -lpthread
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/lib/libpthread.dll.a when searching for -lpthread
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/lib/libpthread.a when searching for -lpthread
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lpthread
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/lib/libadvapi32.a when searching for -ladvapi32
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/lib\libadvapi32.a when searching for -ladvapi32
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/lib/libadvapi32.a when searching for -ladvapi32
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -ladvapi32
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/lib/libshell32.a when searching for -lshell32
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/lib\libshell32.a when searching for -lshell32
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/lib/libshell32.a when searching for -lshell32
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lshell32
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/lib/libuser32.a when searching for -luser32
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/lib\libuser32.a when searching for -luser32
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/lib/libuser32.a when searching for -luser32
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -luser32
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/lib/libkernel32.a when searching for -lkernel32
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/lib\libkernel32.a when searching for -lkernel32
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/lib/libkernel32.a when searching for -lkernel32
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lkernel32
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/lib/libiconv.a when searching for -liconv
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/lib\libiconv.a when searching for -liconv
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/lib/libiconv.a when searching for -liconv
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -liconv
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/lib/libmingwthrd.a when searching for -lmingwthrd
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/lib\libmingwthrd.a when searching for -lmingwthrd
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/lib/libmingwthrd.a when searching for -lmingwthrd
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lmingwthrd
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/lib/libmingw32.a when searching for -lmingw32
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/lib\libmingw32.a when searching for -lmingw32
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/lib/libmingw32.a when searching for -lmingw32
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lmingw32
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/libgcc.a when searching for -lgcc
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0\libgcc.a when searching for -lgcc
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/libgcc.a when searching for -lgcc
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lgcc
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/libgcc_eh.a when searching for -lgcc_eh
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0\libgcc_eh.a when searching for -lgcc_eh
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/libgcc_eh.a when searching for -lgcc_eh
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lgcc_eh
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/lib/libmoldname.a when searching for -lmoldname
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/lib\libmoldname.a when searching for -lmoldname
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/lib/libmoldname.a when searching for -lmoldname
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lmoldname
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/lib/libmingwex.a when searching for -lmingwex
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/lib\libmingwex.a when searching for -lmingwex
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/lib/libmingwex.a when searching for -lmingwex
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lmingwex
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/lib/libmsvcrt.a when searching for -lmsvcrt
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/lib\libmsvcrt.a when searching for -lmsvcrt
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/lib/libmsvcrt.a when searching for -lmsvcrt
    C:/Program Files/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lmsvcrt
    collect2.exe: error: ld returned 1 exit status
    
    opened by ghost 20
  • Linux WebKitGTK Memory Consumption

    Linux WebKitGTK Memory Consumption

    Webview looks to be a very good framework looking at the binary size, which is very tiny compared to the 115mb Electron Hello World, but there is another major problem, memory.

    I'm no benchmarking expert, but this is RAM usage in different UI frameworks:

    (Debian 10 + MATE, 8GB, i7 3770, GT 1030)

    • GTK: ~30mb
    • Webview Framework: 200-300mb, including WebKit being loaded into memory
    • Electron Quick Start: 50-130mb

    (These may be inaccurate, tell me if you have different results)

    Comparing Electron performance to Webview performance, they are about the same, as they both load a web rendering engine into memory.

    And with WebKit being 300mb to install on Linux, it can be seen to be even heavier than Electron if you don't already have it installed.

    There may be some usable alternatives to WebKit, but I think optimizations can be made, even if changing dependencies would not be possible.

    For some people, they may be using this for the HTML/CSS rendering, and don't need JS. At that point, using a UI library would be practical, but I think having an option to disable JS and use WebKit's click event binding feature would not be a bad idea, assuming it is possible within WebKitGTK.

    (I don't think this is an issue with Windows/Android, as their web rendering software is built in and ready to go.)

    Here are some raw benchmarks for WebKitGTK on my old laptop. http://petabyte.heb12.com/filedump/benchmark

    opened by petabyt 19
  • build on darwin fails

    build on darwin fails

    ~/src/webview$ go build -x
    WORK=/var/folders/q_/6fv7kfsj7b11y457c2dsssgw0000gn/T/go-build352003042
    mkdir -p $WORK/webview/_obj/
    mkdir -p $WORK/
    cd /Users/lsm/src/webview
    CGO_LDFLAGS="-g" "-O2" "-framework" "Cocoa" "-framework" "WebKit" /usr/local/Cellar/go/1.8.1/libexec/pkg/tool/darwin_amd64/cgo -objdir $WORK/webview/_obj/ -importpath webview -- -I $WORK/webview/_obj/ -g -O2 -DWEBVIEW_COCOA=1 -x objective-c webview.go
    # webview
    ./webview.go:132:3: struct size calculation error off=8 bytesize=0
    
    ~/src/webview$ uname -a 
    Darwin io.local 16.1.0 Darwin Kernel Version 16.1.0: Wed Oct 19 20:31:56 PDT 2016; root:xnu-3789.21.4~4/RELEASE_X86_64 x86_64
    
    opened by cpq 18
  • Basic JavaScript execution issue

    Basic JavaScript execution issue

    What OS are you using (uname -a, or Windows version)?

    Darwin MacBook-Pro.local 21.6.0 Darwin Kernel Version 21.6.0: Sat Jun 18 17:07:25 PDT 2022; root:xnu-8020.140.41~1/RELEASE_X86_64 x86_64

    What programming language are you using (C/C++/Go/Rust)?

    I'm using Deno (https://github.com/webview/webview_deno) but I am sort of guessing the issue is not with the Deno bindings but with webview itself, so I'm posting here.

    deno 1.23.2 (release, x86_64-apple-darwin)
    v8 10.4.132.8
    typescript 4.7.2
    

    What did you expect to see and what you saw instead?

    It seems like the Webview JS runtime is somehow failing to do closures correctly. Here is my code:

    import { Webview } from "https://deno.land/x/[email protected]/mod.ts";
    
    const wv = new Webview();
    
    wv.bind("log", console.log);
    wv.navigate(`data:text/html,${encodeURIComponent(`
    <html>
      <script>
        try {
          const msg = "hello world";
          log(msg);
          function thing(){
            log(msg);
          }
          thing();
        } catch (err) {
          log(err.message)
        }
      </script>
      <body>
      </body>
    </html>
    `)}`);
    
    wv.run();
    

    and here is the console output:

    hello world
    Can't find variable: msg
    

    naturally, the console output i expect is:

    hello world
    hello world
    
    opened by peetklecha 17
  • Characters represented as '?'

    Characters represented as '?'

    What OS are you using (uname -a, or Windows version)?

    Windows 10 Pro x64

    What programming language are you using (C/C++/Go/Rust)?

    go version go1.14.4 windows/amd64

    What did you expect to see and what you saw instead?

    When i create page with non english content, characters represented as '?'. How to solve that?. Sorry for my English. Sample:

    debug := true
    w := webview.New(debug)
    defer w.Destroy()
    w.SetTitle("Пример")
    w.SetSize(800, 600, webview.HintNone)
    w.Navigate(`data:text/html,
    		<!doctype html>
    		<html>
                            <head>
                              <meta charset="utf-8">
                            </head>
    			<body>Привет мир!</body>
    		</html>
    `)
    w.Run()
    
    opened by bezrazli4n0 17
  • HDPI Support?

    HDPI Support?

    Hi, I really love this library, and it is super useful to me. I was wondering about HDPI support, at least on windows. On my machine, the opened web browser looks very pixelated. IE10 looks just fine, and supports high definition fonts, but the window that this opens up just looks blocky.

    Is there any way I can make the webview work well with HDPI displays?

    help wanted 
    opened by ajusa 17
  • Add some get started tutorial.

    Add some get started tutorial.

    What OS are you using (uname -a, or Windows version)?

    Linux pop-os 5.16.11-76051611-generic #202202230823~1646248261~21.10~2b22243 SMP PREEMPT Wed Mar 2 20: x86_64 x86_64 x86_64 GNU/Linux
    

    What programming language are you using (C/C++/Go/Rust)?

    go version go1.17.7 linux/amd64
    

    What did you expect to see and what you saw instead?

    When I start to use this project, it lack a get started doc. And it makes me take a lot of time to start with. I saw that there is some example added to the project, so is it possible to create some kind of website or markdown file with a simple get-started tutorial for new users? Or some official repository to collect some good projects from the community. It really helps a lot.

    enhancement 
    opened by aimerneige 16
  • Add the option to 'return' the bound argument via pass-by-reference.

    Add the option to 'return' the bound argument via pass-by-reference.

    This will resolve https://github.com/webview/webview/issues/730 and also maintains backwards-compatibility.

    void webview::unbind(const std::string &name) works as before. void webview::unbind(const std::string &name, void *&arg) implements the new desired behavior of "returning" the bound argument via pass-by-reference. void webview_unbind_return(webview_t w, const char *name, void *&arg); is the new C function. I had to change the name since overloading does not exist in C.

    Unbind without returning the arg:

    context_t context = {.w = w, .count = 0};
    webview_bind(w, "increment", increment, &context);
    ...
    webview_unbind(w, "increment");
    

    Unbind, use the arg, and free:

    context_t *context = (context_t*) malloc (sizeof(context_t));
    context->w = w;
    context->count = 0;
    webview_bind(w, "increment", increment, context);
    ...
    void* ptr;
    webview_unbind_return(w, "increment", ptr);
    context_t *context2 = (context_t*) ptr;
    printf("Count: %d\n", context2->count)
    free(ptr);
    

    The correct way to do this in C++ would be to use a template like so: template<typename T> void unbind(const std::string &name, T *& arg). Unfortunately, I could not figure out how to get C to call a C++ template function. Maybe you guys know more about that. This continues the pattern of using void* to accept an argument of any type, but using void*& is a little unsafe.

    opened by dandeto 3
  • master branch reset

    master branch reset

    The master branch was reset back to commit c6824d45faf46b6f4c354216716e6336e847170c on 2022-11-30 because of licensing issues in an already-merged PR:

    • #687

    The problematic commit 3b81983a4106a562cea1d9b1fbf25aa879b8c743 was in the master branch for approximately 7 hours before the reset.

    The old commit history will be available in the master-before-reset-20221130 branch until 2022-12-15, then we will delete the branch.

    We apologize for the inconvenience and suggest that you reset your branches if needed.

    opened by SteffenL 0
  • Windows: application's title bar icon now matches task bar icon

    Windows: application's title bar icon now matches task bar icon

    A few days ago, I left a comment on "Customizing Window Icon" discussion thread on the possibility of giving developers an option to customize their application's icon at runtime. After spending a few minutes scouring through his repo, I believe I found a simple solution for windows users with zero initialization code necessary on the developer's part. My solution incorporates the fact that Visual Studio creates a "resource.h" file whenever the developer adds, say, an icon to their project. Moreover, the default icon in Visual Studio goes by the name "IDI_ICON1". By combining these two facts, I made a simple #if contraption to automatically include the "resource.h" file and check if "IDI_ICON1" is defined. If it turns out to be true, then a variable called WIN_CUSTOM_ICON_RESOURCE_H will be defined and used later in the code to load a different icon.

    opened by suncloudsmoon 2
  • SPA html and local access to js through file://

    SPA html and local access to js through file://

    What OS are you using (uname -a, or Windows version)?

    Windows11

    What programming language are you using (C/C++/Go/Rust)?

    C/C++

    What did you expect to see and what you saw instead?

    For SPA application, loading local js through file:// protocol is not allowed due to CORS problem. Is there any approach provided to overcome this problem except hosting a server and load it through http request, which I don't think is a elegant approach. I noticed that it seems possible to inject js through c++ code, which I think is not a good soluton either. In my case, I build a vue app(spa). I don't want to modify the c/c++ code every time upon a build of the page (page js name may change every time on a build).

    To elaborate a bit more. I have a vue spa built and open the index file content through c++, but the page does not show and have no errors output at the console, so I simply opened the index.html through browser and noticed the warning like the following occur. Access to script at 'file:///C:/Users/alan/Documents/GitHub/AResConvert/assets/index.272d8767.js' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, isolated-app, chrome-extension, chrome-untrusted, https, edge.

    Therefore, I think the reason why the vue spa page does not show (Open through webview library) is because of the local access to the javascript file

    opened by AlanYiNew 5
  • Error: signal arrived during external code execution

    Error: signal arrived during external code execution

    What OS are you using (uname -a, or Windows version)?

    Windows 10 (MINGW64_NT-10.0-19044 DESKTOP-MAIB26H 3.3.6-341.x86_64 2022-11-20 15:12 UTC x86_64 Msys)

    What programming language are you using (C/C++/Go/Rust)?

    Go 1.19.3 (windows/amd64)

    What did you expect to see and what you saw instead?

    I just updated the version of webview in my project and it seems to have a conflict with WebBrowser control from the Windows API which a library I'm using depends on (https://github.com/vslavik/winsparkle/). It compiles no problem, however when I call out to the DLL I'm using it crashes. It was working fine on the old webview version though.

    If I comment out the webview code the DLL calls work fine, and vice versa if I comment out the code using the DLL the webview code works fine.

    See here for a reproducible example: https://github.com/abemedia/webview-exception

    Click here for the full error message
    Exception 0x406d1388 0x1000 0x7ffe1416fda0 0x7ffe4c1fcd29
    PC=0x7ffe4c1fcd29
    signal arrived during external code execution
    
    runtime.cgocall(0x7ff735102520, 0x7ff735261680)
            C:/Program Files/Go/src/runtime/cgocall.go:158 +0x4a fp=0xc00010fe10 sp=0xc00010fdd8 pc=0x7ff7350a416a
    syscall.SyscallN(0x7ffe14009f60?, {0x0?, 0x0?, 0x7ff73510ba20?})
            C:/Program Files/Go/src/runtime/syscall_windows.go:557 +0x109 fp=0xc00010fe88 sp=0xc00010fe10 pc=0x7ff7350fd9e9
    syscall.(*Proc).Call(0xc00007a5d0?, {0x0?, 0x7ff7351ad2c0?, 0xc000054201?})
            C:/Program Files/Go/src/syscall/dll_windows.go:190 +0x25 fp=0xc00010fec8 sp=0xc00010fe88 pc=0x7ff73510b625
    syscall.(*LazyProc).Call(0xc00007a5d0, {0x0, 0x0, 0x0})
            C:/Program Files/Go/src/syscall/dll_windows.go:310 +0x50 fp=0xc00010fef8 sp=0xc00010fec8 pc=0x7ff73510bad0
    github.com/abemedia/go-winsparkle.CheckUpdateWithUI(...)
            C:/Users/adam/go/pkg/mod/github.com/abemedia/[email protected]/winsparkle.go:262
    main.main()
            C:/Users/adam/Documents/Work/webview-exception/broken/main.go:14 +0xe6 fp=0xc00010ff80 sp=0xc00010fef8 pc=0x7ff73514a206
    runtime.main()
            C:/Program Files/Go/src/runtime/proc.go:250 +0x1fe fp=0xc00010ffe0 sp=0xc00010ff80 pc=0x7ff7350d935e
    runtime.goexit()
            C:/Program Files/Go/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc00010ffe8 sp=0xc00010ffe0 pc=0x7ff735100ca1
    
    goroutine 2 [force gc (idle)]:
    runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
            C:/Program Files/Go/src/runtime/proc.go:363 +0xd6 fp=0xc000049fb0 sp=0xc000049f90 pc=0x7ff7350d96f6
    runtime.goparkunlock(...)
            C:/Program Files/Go/src/runtime/proc.go:369
    runtime.forcegchelper()
            C:/Program Files/Go/src/runtime/proc.go:302 +0xb1 fp=0xc000049fe0 sp=0xc000049fb0 pc=0x7ff7350d9591
    runtime.goexit()
            C:/Program Files/Go/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc000049fe8 sp=0xc000049fe0 pc=0x7ff735100ca1
    created by runtime.init.6
            C:/Program Files/Go/src/runtime/proc.go:290 +0x25
    
    goroutine 3 [GC sweep wait]:
    runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
            C:/Program Files/Go/src/runtime/proc.go:363 +0xd6 fp=0xc00004bf90 sp=0xc00004bf70 pc=0x7ff7350d96f6
    runtime.goparkunlock(...)
            C:/Program Files/Go/src/runtime/proc.go:369
    runtime.bgsweep(0x0?)
            C:/Program Files/Go/src/runtime/mgcsweep.go:278 +0x8e fp=0xc00004bfc8 sp=0xc00004bf90 pc=0x7ff7350c432e
    runtime.gcenable.func1()
            C:/Program Files/Go/src/runtime/mgc.go:178 +0x26 fp=0xc00004bfe0 sp=0xc00004bfc8 pc=0x7ff7350b90c6
    runtime.goexit()
            C:/Program Files/Go/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc00004bfe8 sp=0xc00004bfe0 pc=0x7ff735100ca1
    created by runtime.gcenable
            C:/Program Files/Go/src/runtime/mgc.go:178 +0x6b
    
    goroutine 4 [GC scavenge wait]:
    runtime.gopark(0xc00001c150?, 0x7ff7351dcfb0?, 0x1?, 0x0?, 0x0?)
            C:/Program Files/Go/src/runtime/proc.go:363 +0xd6 fp=0xc00005bf70 sp=0xc00005bf50 pc=0x7ff7350d96f6
    runtime.goparkunlock(...)
            C:/Program Files/Go/src/runtime/proc.go:369
    runtime.(*scavengerState).park(0x7ff735260fc0)
            C:/Program Files/Go/src/runtime/mgcscavenge.go:389 +0x53 fp=0xc00005bfa0 sp=0xc00005bf70 pc=0x7ff7350c23b3
    runtime.bgscavenge(0x0?)
            C:/Program Files/Go/src/runtime/mgcscavenge.go:617 +0x45 fp=0xc00005bfc8 sp=0xc00005bfa0 pc=0x7ff7350c29a5
    runtime.gcenable.func2()
            C:/Program Files/Go/src/runtime/mgc.go:179 +0x26 fp=0xc00005bfe0 sp=0xc00005bfc8 pc=0x7ff7350b9066
    runtime.goexit()
            C:/Program Files/Go/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc00005bfe8 sp=0xc00005bfe0 pc=0x7ff735100ca1
    created by runtime.gcenable
            C:/Program Files/Go/src/runtime/mgc.go:179 +0xaa
    
    goroutine 5 [finalizer wait]:
    runtime.gopark(0x7ff7352613c0?, 0x7ff73517efd0?, 0x0?, 0x0?, 0xc00004df70?)
            C:/Program Files/Go/src/runtime/proc.go:363 +0xd6 fp=0xc00004de28 sp=0xc00004de08 pc=0x7ff7350d96f6
    runtime.goparkunlock(...)
            C:/Program Files/Go/src/runtime/proc.go:369
    runtime.runfinq()
            C:/Program Files/Go/src/runtime/mfinal.go:180 +0x10f fp=0xc00004dfe0 sp=0xc00004de28 pc=0x7ff7350b81cf
    runtime.goexit()
            C:/Program Files/Go/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc00004dfe8 sp=0xc00004dfe0 pc=0x7ff735100ca1
    created by runtime.createfing
            C:/Program Files/Go/src/runtime/mfinal.go:157 +0x45
    rax     0x2c
    rbx     0x7ffe1416fda0
    rcx     0x0
    rdi     0x1750
    rsi     0x7ffe1416fda0
    rbp     0xc00010fe00
    rsp     0x472f9ffa00
    r8      0x7ffe4e63b44d
    r9      0x20aa2e20000
    r10     0x2
    r11     0x200
    r12     0x0
    r13     0x0
    r14     0xc000046000
    r15     0x2030000
    rip     0x7ffe4c1fcd29
    rflags  0x202
    cs      0x33
    fs      0x53
    gs      0x2b
    
    opened by abemedia 2
  • Custom URI scheme support

    Custom URI scheme support

    Hi guys? Does webview support custom URIs? As far as I can see it is not: webview. Do you have any plans to add it? The problem is we cannot serve local spa applications without it. localhost is not an option for me.

    Ref:

    • https://webkitgtk.org/reference/webkit2gtk/2.5.1/WebKitWebContext.html#webkit-web-context-register-uri-scheme
    • https://learn.microsoft.com/en-us/dotnet/api/microsoft.web.webview2.core.corewebview2customschemeregistration?view=webview2-dotnet-1.0.1466-prerelease

    Eg.:

    fn void register_uri_scheme(string scheme_name, fn callback) {
    }
    
    webview.register_uri_scheme("my_scheme", uri_handler);
    
    fn bytes_stream uri_handler(string uri) {
        return strict_assets_folder.get_file_bytes(uri)
    }
    
    <!DOCTYPE html>
    <html>
      <head>
        <title>My App</title>
    
        <base href="my_scheme://">
    
        <link rel="icon" type="image/ico" href="/favicon.ico">
    
        <script src="/js/index.b1465023.js"></script>
    
        <link rel="stylesheet" href="/css/index.e607f6df.css">
      </head>
      <body>
        <div id="my-app"><img src="/images/logo.png" /></div>
      </body>
    </html>
    
    opened by fairking 2
Owner
webview
Tiny cross-platform webview library. Uses WebKit (Gtk/Cocoa) and Edge (Windows)
webview
nadesiko3 for webkit

なでしこ3配布キット(nadesiko3webkit) これは、日本語プログラミング言語「なでしこ3(Web版)」で作ったプログラムを配布したい場合に便利なパッケージです。 なでしこで作ったゲームやツールを一般配布するのにご利用ください。 Windows/macOSでは、配布パッケージが用意されてい

kujirahand 2 Nov 15, 2021
Go binding for GTK

go-gtk WHATS Go bindings for GTK SCREENSHOT INSTALL You can experiment with go-gtk by running the various example programs: git clone https://github.c

mattn 1.9k Nov 29, 2022
gobbi is a set of generated Go bindings for gtk et al.

gobbi gobject bindings gobbi is a set of generated Go bindings for gobject based libraries. There are bindings, with varying degrees of completeness,

Mike D Pilsbury 29 May 6, 2022
An example desktop system tray application that can launch HTML5 windows. Go source with a build process for Windows, Mac and Linux.

ExampleTrayGUI An example cross-platform (Mac, Windows, Linux) system tray application that can launch HTML5 windows, developed in Go including functi

Grant Moore 50 Oct 9, 2022
An example desktop system tray application that can launch HTML5 windows. Go source with a build process for Windows, Mac and Linux.

ExampleTrayGUI An example cross-platform (Mac, Windows, Linux) system tray application that can launch HTML5 windows, developed in Go including functi

Grant Moore 51 Dec 3, 2022
An example desktop system tray application that can launch HTML5 windows. Go source with a build process for Windows, Mac and Linux.

An example cross-platform (Mac, Windows, Linux) system tray application that can launch HTML5 windows, developed in Go including functional build process. This repository is intended as a quick reference to help others start similar projects using the referenced libraries and will not be actively maintained.

Grant Moore 51 Dec 3, 2022
An example desktop system tray application that can launch HTML5 windows. Go source with a build process for Windows, Mac and Linux.

ExampleTrayGUI An example cross-platform (Mac, Windows, Linux) system tray application that can launch HTML5 windows, developed in Go including functi

Owen Moore 50 Oct 9, 2022
W32find - Find parent windows and their children windows using win32api.

w32find Package w32find provides a set of interface to win32 APIs that can be used to find windows and their controls. Install go get -v github.com/mo

MoonChant 0 Jan 5, 2022
Cross-platform Go/Golang GUI library.

中文 | English GoVCL Cross-platform Golang GUI library, The core binding is liblcl, a common cross-platform GUI library created by Lazarus. GoVCL is a n

不在乎y 1.7k Nov 30, 2022
Go cross-platform library for displaying dialogs and input boxes

dlgs dlgs is a cross-platform library for displaying dialogs and input boxes. Installation go get -u github.com/gen2brain/dlgs Documentation Document

Milan Nikolic 367 Nov 9, 2022
An experimental Go cross platform UI library.

GXUI - A Go cross platform UI library. Notice: Unfortunately due to a shortage of hours in a day, GXUI is no longer maintained. If you're looking for

Google 4.5k Dec 1, 2022
Cross-platform Go library to place an icon in the host operating system's taskbar.

trayhost Package trayhost is a cross-platform Go library to place an icon in the host operating system's taskbar. Platform Support macOS - Fully imple

null 235 Nov 6, 2022
Cross platform rapid GUI framework for golang based on Dear ImGui.

giu Cross platform rapid GUI framework for golang based on Dear ImGui and the great golang binding imgui-go. Any contribution (features, widgets, tuto

Allen Dang 1.6k Dec 1, 2022
Build cross platform GUI apps with GO and HTML/JS/CSS (powered by Electron)

Thanks to go-astilectron build cross platform GUI apps with GO and HTML/JS/CSS. It is the official GO bindings of astilectron and is powered by Electr

Quentin Renard 4.6k Dec 9, 2022
Build cross platform GUI apps with GO and HTML/JS/CSS (powered by nwjs)

gowd Build cross platform GUI apps with GO and HTML/JS/CSS (powered by nwjs) How to use this library: Download and install nwjs Install this library g

Danny 386 Dec 1, 2022
Cross-platform GUI for go is never this easy and clean.

gimu Strongly suggest NOT to use this project anymore, the auto-generated cgo wrapper of Nuklear has a random crash issue which is hard to fix (becaus

Allen Dang 66 Jul 12, 2022
Cross platform GUI in Go based on Material Design

About Fyne is an easy to use UI toolkit and app API written in Go. It is designed to build applications that run on desktop and mobile devices with a

Fyne.io 18.9k Dec 3, 2022
Build cross-platform modern desktop apps in Go + HTML5

Lorca A very small library to build modern HTML5 desktop apps in Go. It uses Chrome browser as a UI layer. Unlike Electron it doesn't bundle Chrome in

Serge Zaitsev 7.5k Dec 5, 2022
RobotGo, Go Native cross-platform GUI automation @vcaesar

Robotgo Golang Desktop Automation. Control the mouse, keyboard, bitmap, read the screen, Window Handle and global event listener. RobotGo supports Mac

vgo 8k Dec 2, 2022