Giter VIP home page Giter VIP logo

webview2's Introduction

webview2

A proof of concept for using the Microsoft Edge WebView2 without cgo and with embedded copies of the webview DLL.

This is a fork of https://github.com/jchv/go-webview2, with a different API that suited my needs better than the original package.

It also uses some bits from https://github.com/Inkeliz/gowebview, specifically the way the COM procedures are called.

Notice

This requires you to have the WebView2 runtime installed, as it doesn't ship with Windows.

Non-goals

  • EdgeHTML fallback
  • Support for other platforms than Windows on amd64

webview2's People

Contributors

github-actions[bot] avatar jchv avatar mattpodraza avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

wwderw d4v1dw3bb

webview2's Issues

Failed to run executible on clean windows install

Hi matt,

While everything should be embedded in one executable it should be possible to run the executable on an other computer.
I've just build your advanced example. Installed a fresh instance of windows on vmware player and moved the executable to that instance.

When I run it i get:

2021/06/15 02:28:31 Failed to create webview2: failed to initialize the window: failed to embed the browser: failed to call CreateCoreWebView2EnvironmentWithOptions: The system could not find the environment option that was entered.

It looks like it's some how not embedded :(.

On the development machine it works.

Regards,

D4v1d

Implement the remaining options

That is WithDevtools, WithDefaultContextMenus, etc.

// The following are not yet implemented, they do nothing.
func WithDevtools(enabled bool) Option {
return func(wv *WebView) error {
wv.config.devtoolsDisabled = !enabled
return nil
}
}
func WithDefaultContextMenus(enabled bool) Option {
return func(wv *WebView) error {
wv.config.defaultContextMenusDisabled = !enabled
return nil
}
}
func WithDefaultScriptDialogs(enabled bool) Option {
return func(wv *WebView) error {
wv.config.defaultScriptDialogsDisabled = !enabled
return nil
}
}
func WithHostObjects(enabled bool) Option {
return func(wv *WebView) error {
wv.config.hostObjectsDisallowed = !enabled
return nil
}
}
func WithBuiltInErrorPage(enabled bool) Option {
return func(wv *WebView) error {
wv.config.builtInErrorPageDisabled = !enabled
return nil
}
}
func WithScript(enabled bool) Option {
return func(wv *WebView) error {
wv.config.scriptDisabled = !enabled
return nil
}
}
func WithStatusBar(enabled bool) Option {
return func(wv *WebView) error {
wv.config.statusBarDisabled = !enabled
return nil
}
}
func WithWebMessage(enabled bool) Option {
return func(wv *WebView) error {
wv.config.webMessageDisabled = !enabled
return nil
}
}
func WithZoomControl(enabled bool) Option {
return func(wv *WebView) error {
wv.config.zoomControlDisabled = !enabled
return nil
}
}

Fails on restoring the window

If you minimize the window and try to restore it again, the webview.Run function will fail with Failed while running webview: failed to get message: The parameter is incorrect.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.