From 0c2963cf53a80cce13e5bfe00d258266926adf86 Mon Sep 17 00:00:00 2001 From: Lea Anthony Date: Sat, 23 Oct 2021 07:17:58 +1100 Subject: [PATCH] [windows] Add webview2 permissions --- v2/go.mod | 2 +- v2/go.sum | 4 ++-- v2/internal/frontend/desktop/windows/frontend.go | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/v2/go.mod b/v2/go.mod index 5058ae248..d0058db4b 100644 --- a/v2/go.mod +++ b/v2/go.mod @@ -21,7 +21,7 @@ require ( github.com/leaanthony/debme v1.2.1 github.com/leaanthony/go-ansi-parser v1.0.1 github.com/leaanthony/go-common-file-dialog v1.0.3 - github.com/leaanthony/go-webview2 v0.0.0-20211022094055-cb5c7d8dc4ff + github.com/leaanthony/go-webview2 v0.0.0-20211022194343-1e4c8d4226f3 github.com/leaanthony/gosod v1.0.3 github.com/leaanthony/idgen v1.0.0 github.com/leaanthony/slicer v1.5.0 diff --git a/v2/go.sum b/v2/go.sum index fa1e4aa4a..592545177 100644 --- a/v2/go.sum +++ b/v2/go.sum @@ -115,8 +115,8 @@ github.com/leaanthony/go-ansi-parser v1.0.1 h1:97v6c5kYppVsbScf4r/VZdXyQ21KQIfeQ github.com/leaanthony/go-ansi-parser v1.0.1/go.mod h1:7arTzgVI47srICYhvgUV4CGd063sGEeoSlych5yeSPM= github.com/leaanthony/go-common-file-dialog v1.0.3 h1:O0uGjKnWtdEADGrkg+TyAAbZylykMwwx/MNEXn9fp+Y= github.com/leaanthony/go-common-file-dialog v1.0.3/go.mod h1:TGhEc9eSJgRsupZ+iH1ZgAOnEo9zp05cRH2j08RPrF0= -github.com/leaanthony/go-webview2 v0.0.0-20211022094055-cb5c7d8dc4ff h1:zxf4jeeQ8hR8KrR468sB1ooSEItJb84IULPnrhaxGDU= -github.com/leaanthony/go-webview2 v0.0.0-20211022094055-cb5c7d8dc4ff/go.mod h1:lS5ds4bruPk9d7lzdF/OH31Z0YCerI6MmHNFGsWoUnM= +github.com/leaanthony/go-webview2 v0.0.0-20211022194343-1e4c8d4226f3 h1:qhgrg3MhFRAIvtaqoqI+SrT+0wDYpxDMp9e3cvcxMpI= +github.com/leaanthony/go-webview2 v0.0.0-20211022194343-1e4c8d4226f3/go.mod h1:lS5ds4bruPk9d7lzdF/OH31Z0YCerI6MmHNFGsWoUnM= github.com/leaanthony/gosod v1.0.3 h1:Fnt+/B6NjQOVuCWOKYRREZnjGyvg+mEhd1nkkA04aTQ= github.com/leaanthony/gosod v1.0.3/go.mod h1:BJ2J+oHsQIyIQpnLPjnqFGTMnOZXDbvWtRCSG7jGxs4= github.com/leaanthony/idgen v1.0.0 h1:IZreR+JGEzFV4yeVuBZA25gM0keUoFy+RDUldncQ+Jw= diff --git a/v2/internal/frontend/desktop/windows/frontend.go b/v2/internal/frontend/desktop/windows/frontend.go index f5913783d..2f551cd15 100644 --- a/v2/internal/frontend/desktop/windows/frontend.go +++ b/v2/internal/frontend/desktop/windows/frontend.go @@ -298,9 +298,11 @@ func (f *Frontend) setupChromium() { if err != nil { log.Fatal(err) } + // Set background colour f.WindowSetRGBA(f.frontendOptions.RGBA) + chromium.SetGlobalPermission(edge.CoreWebView2PermissionStateAllow) chromium.AddWebResourceRequestedFilter("*", edge.COREWEBVIEW2_WEB_RESOURCE_CONTEXT_ALL) chromium.Navigate(f.startURL) }