Description
Configures the settings for the WebBrowser control. The global settings are also configured.
Note that some settings must be set before the WebBrowser control is initialized. These settings should be set in the application Open event.
Syntax
WebBrowserSet (string n, string v)
Argument |
Description |
---|---|
n |
The name of the setting that is case insensitive. The setting can be: NoteThe settings including RuntimeMode, FixedVersionRuntimePath, allow-file-access-from-files, UserDataFolder, Language, and UserAgent must be set before the WebBrowser control is initialized. It is recommended that you set it in the application Open event. If you have run the application (that includes the WebBrowser control) from PowerBuilder IDE, you may need to restart the application and the PowerBuilder IDE before the program can successfully initialize the WebBrowser control again.
|
v |
The value of the setting to be set.
|
Return value
Integer.
Returns values as follows. If any argument's value is null, the method returns null.
-
1 -- Success
-
-1 -- Failed to execute the line.
-
-2 -- Failed to initialize the control and obtain the WebBrowser object. The WebView2 is invalid.
-
-4 -- The target path does not exist.
-
-5 -- The URI is invalid.
-
-6 -- The specified download task does not exist.
-
-8 -- The setting item does not exist.
-
-9 -- The path is invalid or does not exist.
-
-11 -- Unknown error.
-
-12 -- Invalid event name.
-
-14 -- Invalid argument.
-
-15 -- Failed to create screenshot file.
-
-16 -- There is a print job in progress, which cannot be closed.
-
-17 -- Could not find the corresponding item.
Examples
The following example configures the language settings for the WebBrowser control in the application Open event.
long ll_Ret ll_Ret =WebBrowserSet("Language", "de-DE")
See also
Description
Configures the settings for the WebBrowser control.
Syntax
WebBrowserSet (string n, string v)
Argument |
Description |
---|---|
n |
The name of the setting. The setting can be:
|
v |
The value of the setting to be set. |
Return value
Integer.
Returns the following error code:
-
1 -- Success
-
-7 -- CEF has been initialized, and the current item can only be set before CEF initialization.
-
-8 -- The setting name does not exist.
-
-9 -- The path is invalid or does not exist.
Examples
The following example configures the proxy settings for the WebBrowser control in the application Open event.
Open(string commandline) { WebBrowserSet ("ProxyAddress", "192.168.5.16") WebBrowserSet ("ProxyPort", "8080") WebBrowserSet ("ProxyUser", "Admin") WebBrowserSet ("ProxyPassword", "123Test") }
See also