Symptom

When using the WebBrowserSet function to set proxy parameters, it returns a value of -8 (The setting item does not exist.)


Environment

PowerBuilder 2019 R3 Build 2797 and later

PowerBuilder 2022 R2 GA Build 1878 and later

PowerBuilder 2025 GA Build 3683 and later


Cause

The WebBrowserSet function doesn’t support setting proxy parameters. (Only limited items are supported by WebBrowserSet at present. This has been recorded as one of the requirements that will be considered in future versions.)


Resolution

You can implement setting WebView2 browser flags by setting the registry or the system environment variables. The following takes "proxy-server" as an example.


1. Registry

Please follow the instructions below, or you can directly create the registry item.

1) Open an Administrative Command Prompt or Windows PowerShell Admin console.

2) Execute the command below:

reg add HKCU\SOFTWARE\Policies\Microsoft\Edge\WebView2\AdditionalBrowserArguments /v * /d "--proxy-server=ip_of_proxy:port"

how to set webview2 browser flags


2. System Environment Variables

Add the following new variable to the System Environment Variables:

Variable Name: WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS
Variable Value: --proxy-server=ip_of_proxy:port 

how to set webview2 browser flags via environment variables


For more information on WebView2 browser flags and relevant settings, please refer to the articles below.

https://learn.microsoft.com/en-us/microsoft-edge/webview2/concepts/webview-features-flags?tabs=dotnetcsharp

https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/webview2-idl?view=webview2-1.0.2592.51#createcorewebview2environmentwithoptions

 

0
0