Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion v2/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ require (
github.com/tc-hib/winres v0.3.1
github.com/tidwall/sjson v1.2.5
github.com/tkrajina/go-reflector v0.5.8
github.com/wailsapp/go-webview2 v1.0.22
github.com/wailsapp/go-webview2 v1.0.23
github.com/wailsapp/mimetype v1.4.1
github.com/wzshiming/ctc v1.2.3
golang.org/x/mod v0.23.0
Expand Down
2 changes: 2 additions & 0 deletions v2/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,8 @@ github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQ
github.com/valyala/fasttemplate v1.2.2/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ=
github.com/wailsapp/go-webview2 v1.0.22 h1:YT61F5lj+GGaat5OB96Aa3b4QA+mybD0Ggq6NZijQ58=
github.com/wailsapp/go-webview2 v1.0.22/go.mod h1:qJmWAmAmaniuKGZPWwne+uor3AHMB5PFhqiK0Bbj8kc=
github.com/wailsapp/go-webview2 v1.0.23 h1:jmv8qhz1lHibCc79bMM/a/FqOnnzOGEisLav+a0b9P0=
github.com/wailsapp/go-webview2 v1.0.23/go.mod h1:qJmWAmAmaniuKGZPWwne+uor3AHMB5PFhqiK0Bbj8kc=
github.com/wailsapp/mimetype v1.4.1 h1:pQN9ycO7uo4vsUUuPeHEYoUkLVkaRntMnHJxVwYhwHs=
github.com/wailsapp/mimetype v1.4.1/go.mod h1:9aV5k31bBOv5z6u+QP8TltzvNGJPmNJD4XlAL3U+j3o=
github.com/wzshiming/ctc v1.2.3 h1:q+hW3IQNsjIlOFBTGZZZeIXTElFM4grF4spW/errh/c=
Expand Down
24 changes: 17 additions & 7 deletions v2/internal/frontend/desktop/windows/frontend.go
Original file line number Diff line number Diff line change
Expand Up @@ -488,12 +488,6 @@ func (f *Frontend) setupChromium() {
chromium.AdditionalBrowserArgs = append(chromium.AdditionalBrowserArgs, arg)
}

if f.frontendOptions.DragAndDrop != nil && f.frontendOptions.DragAndDrop.DisableWebViewDrop {
if err := chromium.AllowExternalDrag(false); err != nil {
f.logger.Warning("WebView failed to set AllowExternalDrag to false!")
}
}

chromium.MessageCallback = f.processMessage
chromium.MessageWithAdditionalObjectsCallback = f.processMessageWithAdditionalObjects
chromium.WebResourceRequestedCallback = f.processRequest
Expand Down Expand Up @@ -545,8 +539,23 @@ func (f *Frontend) setupChromium() {
}
}
}

f.logger.Debug("About to call chromium.Embed()")
chromium.Embed(f.mainWindow.Handle())
f.logger.Debug("chromium.Embed() completed successfully")

// Handle drag and drop configuration after WebView2 is embedded
// This must be done after Embed() to avoid "Not enough memory" errors
if f.frontendOptions.DragAndDrop != nil && f.frontendOptions.DragAndDrop.EnableFileDrop {
if chromium.HasCapability(edge.AllowExternalDrop) {
f.logger.Debug("Calling AllowExternalDrag(false) after Embed")
err := chromium.AllowExternalDrag(false)
if err != nil {
f.logger.Warning("WebView failed to set AllowExternalDrop to false: %s", err)
} else {
f.logger.Debug("AllowExternalDrag(false) succeeded")
}
}
}

if chromium.HasCapability(edge.SwipeNavigation) {
swipeGesturesEnabled := f.frontendOptions.Windows != nil && f.frontendOptions.Windows.EnableSwipeGestures
Expand Down Expand Up @@ -643,6 +652,7 @@ func (f *Frontend) processRequest(req *edge.ICoreWebView2WebResourceRequest, arg

//Get the request
uri, _ := req.GetUri()
f.logger.Debug("processRequest called for URI: %s", uri)
reqUri, err := url.ParseRequestURI(uri)
if err != nil {
f.logger.Error("Unable to parse equest uri %s: %s", uri, err)
Expand Down
7 changes: 7 additions & 0 deletions website/src/pages/changelog.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed

- Fixed Windows WebView2 initialization order issue causing "Not enough memory" errors [#4701](https://github.com/wailsapp/wails/issues/4701) [#4700](https://github.com/wailsapp/wails/issues/4700) [#4694](https://github.com/wailsapp/wails/issues/4694)

## v2.11.0 - 2025-11-08

### Added
Expand All @@ -32,6 +36,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fixed Discord badge in README by @sharkmu in [PR](https://github.com/wailsapp/wails/pull/4626)
- Fixed HTML DnD by @leaanthony

### Changed
- Updated go-webview2 to v1.0.23

## v2.10.2 - 2025-07-06

### Fixed
Expand Down
Loading