mirror of
https://github.com/wailsapp/wails.git
synced 2026-03-14 14:45:49 +01:00
Custom Windows Webview2 Args (#4467)
* Adding the ability to pass custom args to windows webview2 --------- Co-authored-by: Jason Gibson <jason@harbingerinteractive.com> Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
This commit is contained in:
parent
ed81ab01e7
commit
4c70d4501e
3 changed files with 12 additions and 4 deletions
|
|
@ -15,7 +15,9 @@ This file is automatically processed by the nightly release workflow.
|
|||
After processing, the content will be moved to the main changelog and this file will be reset.
|
||||
-->
|
||||
|
||||
### Added
|
||||
## Added
|
||||
<!-- New features, capabilities, or enhancements -->
|
||||
- Added `AdditionalLaunchArgs` to `WindowsWindow` options to allow for additional command line arguments to be passed to the WebView2 browser. in [PR](https://github.com/wailsapp/wails/pull/4467)
|
||||
- Added Run go mod tidy automatically after wails init [@triadmoko](https://github.com/triadmoko) in [PR](https://github.com/wailsapp/wails/pull/4286)
|
||||
- Windows Snapassist feature by @leaanthony in [PR](https://github.dev/wailsapp/wails/pull/4463)
|
||||
|
||||
|
|
|
|||
|
|
@ -292,13 +292,15 @@ type WindowsWindow struct {
|
|||
// PasswordAutosaveEnabled enables autosaving passwords
|
||||
PasswordAutosaveEnabled bool
|
||||
|
||||
// EnabledFeatures and DisabledFeatures are used to enable or disable specific features in the WebView2 browser.
|
||||
// EnabledFeatures, DisabledFeatures and AdditionalLaunchArgs are used to enable or disable specific features in the WebView2 browser.
|
||||
// Available flags: https://learn.microsoft.com/en-us/microsoft-edge/webview2/concepts/webview-features-flags?tabs=dotnetcsharp#available-webview2-browser-flags
|
||||
// WARNING: Apps in production shouldn't use WebView2 browser flags,
|
||||
// because these flags might be removed or altered at any time,
|
||||
// and aren't necessarily supported long-term.
|
||||
EnabledFeatures []string
|
||||
DisabledFeatures []string
|
||||
// AdditionalLaunchArgs should always be preceded by "--"
|
||||
EnabledFeatures []string
|
||||
DisabledFeatures []string
|
||||
AdditionalLaunchArgs []string
|
||||
}
|
||||
|
||||
type Theme int
|
||||
|
|
|
|||
|
|
@ -1798,6 +1798,10 @@ func (w *windowsWebviewWindow) setupChromium() {
|
|||
chromium.AdditionalBrowserArgs = append(chromium.AdditionalBrowserArgs, arg)
|
||||
}
|
||||
|
||||
if len(opts.AdditionalLaunchArgs) > 0 {
|
||||
chromium.AdditionalBrowserArgs = append(chromium.AdditionalBrowserArgs, opts.AdditionalLaunchArgs...)
|
||||
}
|
||||
|
||||
chromium.DataPath = globalApplication.options.Windows.WebviewUserDataPath
|
||||
chromium.BrowserPath = globalApplication.options.Windows.WebviewBrowserPath
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue