Use the global functions WebBrowserSet and WebBrowserGet to configure the path, user agent and proxy settings for the WebBrowser control.
Path settings:
-
CachePath -- The folder that stores the web page cache, cookies etc.
-
UserDataPath -- The folder that stores the user data dictionary.
-
DownloadPath -- The default download path.
User agent settings:
-
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.
Proxy settings:
-
ProxyAuto -- Whether to use auto proxy detection. WebBrowser supports auto proxy detection, PAC (proxy auto configuration) file setting, and manual proxy settings. The priority order of the settings is: auto proxy detection > PAC file setting > manual proxy settings. By default the IE proxy is used.
-
ProxyPacUrl -- The URL of the server where the PAC file is located.
-
ProxyAddress -- The address of the proxy server.
-
ProxyPort -- The port of the proxy server.
-
ProxyUser -- The user name that will be authenticated by the proxy server.
-
ProxyPassword -- The password that will be authenticated by the proxy server.
Local file access:
-
allow-file-access-from-files -- Whether to allow access to the local files (XML etc.).
-
enable-media-stream -- Whether to allow access to the microphone or camera.
Debug:
-
remote-debugging-port -- Whether to enable remote debugging over HTTP on the specified port.
Note
Some of the above settings such as CachePath, UserDataPath, UserAgent, allow-file-access-from-files, enable-media-stream, and remote-debugging-port 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.
Note
For code examples of using the WebBrowser control in the PowerBuilder application, refer to https://github.com/Appeon/PowerBuilder-Graph-Example.