Configuring WebBrowser global settings

Use WebBrowserSet and WebBrowserGet to configure the following settings for the WebBrowser control:

  • RuntimeMode -- The runtime mode of WebView2. For description of this setting, refer to the section called Choosing a WebView2 runtime version.

  • FixedVersionRuntimePath -- The path of WebView2 Runtime Fixed Version. For description of this setting, refer to the section called Choosing a WebView2 runtime version.

  • DownloadPath -- The default download path.

  • allow-file-access-from-files -- Whether to allow access to the local files (XML etc.). allow-file-access-from-files must be used with UserDataFolder, and each application must have its own UserDataFolder, otherwise WebBrowser may not work properly.

  • UserDataFolder -- The folder that stores user data. Both the relative path and absolute path are supported.

  • Language -- The language of WebBrowser control to be set.

  • UserAgent -- The User-Agent request header that contains a characteristic string that allows the network protocol peers to identify the application type, operating system, software vendor or software version of the requesting software user agent.

Note

The above settings except DownloadPath must be set before the WebBrowser control is initialized. You can set them in the application Open event.

If you have run the application (that includes the WebBrowser control) from PowerBuilder IDE, you may need to restart PowerBuilder IDE before the program can successfully initialize the WebBrowser control again.