2.1.0 • Published 3 years ago
cordova-plugin-browser v2.1.0
cordova-plugin-browser

Open browser in your app
The project allows to load urls in SFSafariViewController/Chrome Custom Tabs.
Installation
$ cordova plugin add cordova-plugin-browserUse variable ANDROIDX_BROWSER_VERSION to override dependency version on Android:
$ cordova plugin add cordova-plugin-browser --variable ANDROIDX_BROWSER_VERSION='1.0.+'Supported Platforms
- iOS
- Android
Functions
onClose
onClose(callback, errorCallback?): void
Trigger a callback when browser activity was closed.
Example
cordova.plugins.browser.onClose(() => {
console.log("browser activity was closed");
});Parameters
| Name | Type | Description |
|---|---|---|
callback | () => void | Callback function |
errorCallback? | (error: string) => void | Error callback function |
Returns
void
onLoad
onLoad(callback, errorCallback?): void
Trigger a callback when browser finished loading page successfully.
Example
cordova.plugins.browser.onLoad(() => {
console.log("my url is loaded");
});Parameters
| Name | Type | Description |
|---|---|---|
callback | () => void | Callback function |
errorCallback? | (error: string) => void | Error callback function |
Returns
void
open
open(url, options): Promise<void>
Opens a url in browser activity.
Example
cordova.plugins.browser.open("https://google.com");
cordova.plugins.browser.open("https://google.com", {readerMode: true});Parameters
| Name | Type | Description |
|---|---|---|
url | any | The url to open. |
options | any | The options for the browser. |
Returns
Promise<void>
Callback when operation is completed