cordova-plugin-browser

Open browser in your app

Usage no npm install needed!

<script type="module">
  import cordovaPluginBrowser from 'https://cdn.skypack.dev/cordova-plugin-browser';
</script>

README

cordova-plugin-browser
NPM version NPM downloads Twitter

Open browser in your app

The project allows to load urls in SFSafariViewController/Chrome Custom Tabs.

Installation

cordova plugin add cordova-plugin-browser --save

Use variable CUSTOMTABS_VERSION to override dependency version on Android.

Supported Platforms

  • iOS
  • Android

Methods

open(url, options)

Opens a url in browser activity.

cordova.plugins.browser.open("https://google.com");

On iOS you can set option readerMode to open Safari in reader mode:

cordova.plugins.browser.open("https://google.com", {readerMode: true});

onLoad(callback)

Callback is triggered when browsers finished loading page successfully.

cordova.plugins.browser.onLoad(function() {
    console.log("my url is loaded");
});

onClose(callback)

Callback is triggered when browser activity was closed.

cordova.plugins.browser.onLoad(function() {
    console.log("browser activity was closed");
});