Skip to content

XIDA/cl.kunder.webview

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cl.kunder.webview

This cordova plugin enables you to open a second webview in your app. This webview is totally independent from the main webview, but allows you tu access plugins and other Cordova resources.

It's possible to modify this plugin to allow multiple webviews.

Report issues on github issue tracker

Installation

    cordova plugin add github.com/kunder-lab/cl.kunder.webview.git

Supported Platforms

  • Android
  • iOS

Quick Start

To open a new webview, just call in your app's js:

    webview.Show(URL);

Where URL is the path to the page to be opened. In Android, the plugin automatically adds the prefix file:///android_asset/www/

Then, to close the second webview and return to the main view, call in your second webview (the opened webview, not the main webview):

    webview.Close();

This will close and destroy the second webview.

webView

The webViewobject provides a way to manage a second webview inside your cordova app. This could be usefull if you want to open a second page as a popup or you want to load new content that is totally unrelated to the main view, but still have the ability to use cordova plugins.

The main difference with inAppBrowser plugin is that cl.kunder.webview plugin can access and use all cordova plguins installed in your app.

Methods

  • Show: Opens a new webView
  • Close: Close and destroy the webView
  • Hide: Same as Close
  • SubscribeCallback: Suscribes a callback that is fired when webView is closed

Show

Parameters:

  • url: The url to be opened. In Android, if the url does not contain a http:// or https:// prefix, the prefix file:///android_asset/www/ will be automatically added. (String)
  • successCallback: Is triggered when the plugin is succesfully called. (Function)
  • errorCallback: Is triggered when the plugin fails to be called or is called with error. (Function)

Close/Hide

Parameters:

  • successCallback: Is triggered when the plugin is succesfully called. (Function)
  • errorCallback: Is triggered when the plugin fails to be called or is called with error. (Function)

SubscribeCallback

Suscribes a callback that is triggered when a webView is closed.

Parameters:

  • successCallback: The callback that will be called when a webview is closed. (Function)
  • errorCallback: Is triggered when the plugin fails to be called or is called with error. (Function)

About

This cordova plugin enables you to open a second webview

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Objective-C 46.8%
  • Java 46.5%
  • JavaScript 6.7%