Represents an object that enables opening a URL address from within the web application.
Depending on configuration settings, the URL is opened either within the application or in an external browser. If the internal browser is used, it is shared among all the web applications running within Pega Mobile Client, therefore the browser can be closed by a different web application than the one that has opened it. In such a case events are passed to all web applications (including bootstrap).
On iOS, the internal browser displays a floating
button, which enables returning to the web application.On Windows Phone 8, the window.close
method is not
available.
You can access the object using the launchbox.Browser
reference.
The table below lists all constant values of the Browser
object,
used as failure codes in the onLoadFailure
callback.
Name | Description |
---|---|
INTERNAL_ERROR | Denotes that an internal error has occurred. |
TIMEOUT_ERROR | Denotes that a timeout has occurred. |
CANNOT_FIND_HOST_ERROR | Denotes that the browser can not find a host. |
CANNOT_CONNECT_TO_HOST_ERROR | Denotes that the browser is unable to connect to the host. |
MALFORMED_URL_ERROR | Denotes that the URL address is not a valid URL. |
REDIRECT_LOOP_ERROR | Denotes that a page cannot be loaded due to a redirect loop. |
GENERAL_URL_LOAD_ERROR | Denotes that a general error has occurred. |
Name | Description | Return type |
---|---|---|
start | Opens a URL address within the application or in an external browser, depending on configuration settings. |
undefined |
close | Closes the browser's window, once called from the web application. |
undefined |
addListener | Adds a |
undefined |
removeListener | Removes the listener added using the |
undefined |
Apart from its regular methods, the Web Browser API provides support for custom methods
that replace the regular window.open
and
window.close
methods provided by the device's native
WebView.
Name | Description | Return type |
---|---|---|
window.open | Opens a URL address in a pop-up WebView or in an external browser, depending on configuration settings. |
undefined |
window.close | Closes the browser WebView window, once called from this window. This method does not work on Windows Phone 8. |
undefined |