GithubHelp home page GithubHelp logo

cyberzilla / cordova-plugin-inappbrowser Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mwaylabs/cordova-plugin-inappbrowser

0.0 1.0 0.0 97 KB

Java 72.21% Objective-C 27.23% JavaScript 0.56%

cordova-plugin-inappbrowser's Introduction

cordova-plugin-inappbrowser

This plugin adds a customizable in app browser to your cordova application.

 $window.webview.openWebView(success, failure, {
      iconColor: '#ffff00',
      backgroundColor: '#f00000',
      isPDF: false,
      url: 'http://mwaysolutions.com',
      urlEncoding: false,
      visibleAddress: false,
      editableAddress: false,
      navigationAtTop: false,
      icons:{
        backward: true,
        forward: true,
        refresh: true
      },
      iconsResources:{
        backward: 'file://main/assets/images/backward.png',
        forward: 'file://main/assets/images/forward.png',
        refresh: 'file://main/assets/images/refresh.png',
        close: 'file://main/assets/images/close.png'
      }
    });

Installation

  $ cordova plugin add https://github.com/mwaylabs/cordova-plugin-inappbrowser.git

Options

  • All parameters are required except navigationAtTop (when not specified the navigation will show at the bottom), urlEncoding (when not specified the url will not be encoded), iconsResources (when not specified the default icons will be used) and iconColor (when not specified the icons will not be tinted).

  • iconColor: Defines the color of the icons expectes a string with a colorcode e.g. '#000000'

  • backgroundColor: Defines the backgroundcolor of the bar at the bottom of the webview, expectes a string with a colorcode e.g. '#FFFFFF'

  • isPDF: Defines whether to show or hide the navigation buttons (next, back, reload) expects a boolean

  • url: The url of the resource to show. expects a string with a valid url

  • urlEncoding: Defines whether to encode or not the url (not encoding by default). Expects a boolean

  • visibleAddress: (Only for Android) Defines whether if you can see the address url you are visiting or not. Expects a boolean.

  • editableAddress: (Only for Android) Defines whether if you can edit the address url you are visiting or not. Expects a boolean.

  • navigationAtTop: Defines whether to position the navigation at the top or at the bottom of screen (bottom by default). Expects a boolean

  • icons: Expects an object { (ignored when 'isPDF' is true)

    • backward: Defines whether the backward button is shown or not. Expects a boolean.
    • forward: Defines whether the forward button is shown or not. Expects a boolean.
    • refresh: Defines whether the refresh button is shown or not. Expects a boolean. },
  • iconsResources: Expects an object { (ignored when 'isPDF' is true and it will be tinted if there is a value in 'iconColor')

    • backward: Defines the icon for the backward button. Expects either resource files, files from the device storage or assets from within the www folder.
    • forward: Defines the icon for the forward button. Expects either resource files, files from the device storage or assets from within the www folder.
    • refresh: Defines the icon for the refresh button. Expects either resource files, files from the device storage or assets from within the www folder.
    • close: Only for iOS. Defines the icon for the close button. Expects either resource files, files from the device storage or assets from within the www folder. }

Examples of "iconsResources"

Using native app resources

Each app has a resource folder, e.g. the res folder for Android apps or the Resources folder for iOS apps. The following example shows how to use the app icon from within the app's resource folder.

    backward:'res://ic_back_icon', //=> res/drawable/ic_back_icon.png (Android)
    close:'res://ic_nav_close.png' //=> Resources/ic_nav_close (iOS)

Using assets from the www folder

The path to the files must be defined relative from the root of the mobile web app folder, which is located under the www folder.

    backward:'file://www/main/assets/images/logo.png', //=> www/main/assets/images/logo.png (Android)
    refresh:'file://img/logo.png' //=> www/img/logo.png (iOS)

Using files from the device storage

The path to the files must be defined absolute from the root of the file system.

    backward:'file:///sdcard/Pictures/icon.png', //=> (Android)
    refresh:'file:///icon.png' //=> (iOS)

Supported Platforms

  • iOS 7+
  • Android 4.4+

License

Code licensed under MIT. Docs under Apache 2. PhoneGap is a trademark of Adobe.

cordova-plugin-inappbrowser's People

Contributors

alejandromway avatar drmabuse23 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.