Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

10 Commits

Repository files navigation

Nativescript Chrome Tabs appleandroid

npmGitHubBuild StatusnpmGitHub issuesStatusTwitter Follow

Chrome Tabs Plugin to open a custom chrome/safari tabs in android & ios.

Installation

tns plugin add nativescript-chrome-tabs

Demo

Demo 1Demo 2
Demo 3Demo 4

Usage

<Buttontext="click" (tap)="myCustomWeb();">

Javascript

var{ initChromeTab, openChromeTab }=require('nativescript-chrome-tabs');constructor(){initChromeTab();}functionmyCustomWeb(){openChromeTab({url: 'http://google.com',toolbarColor: '#0361cc',toolbarControlsColor: '#303F9F'});}

Typescript

import{initChromeTab,openChromeTab}from"nativescript-chrome-tabs";constructor(){initChromeTab();}myCustomWeb(){openChromeTab({url: 'http://google.com',toolbarColor: '#0361cc',toolbarControlsColor: '#303F9F'});}

API (Properties)

PropertyDefaultDescription
urlrequiredThe URL to open
showTitlefalseShows title bar in the webview
toolbarColorundefinedColor of the toolbar
toolbarControlsColorundefined(only iOS) color of buttons on toolbar
isClosedundefinedcallback function that will be called when webview is closed

API (Methods)

MethodTypeReturnsDescription
initChromeTab();constructorvoidTo Initialize Chrome Tab
openChromeTab(url : String, toolbarColor : String, toolbarControlsColor : String);methodvoidTo Open a Chrome Tab

https://developer.chrome.com/docs/multidevice/android/customtabs/