# cordova-plugin-devonics-tabs

> In-app browser tabs for Android and iOS

Latest version **1.0.1** (published 2022-01-13) · GPL license · 0 weekly downloads

## Install

```sh
npm install cordova-plugin-devonics-tabs
pnpm add cordova-plugin-devonics-tabs
yarn add cordova-plugin-devonics-tabs
bun add cordova-plugin-devonics-tabs
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2022-01-13 |
| First published | 2022-01-13 |
| Weekly downloads | 0 |
| License | GPL |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 16.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Devonics |
| Maintainers | devonics |
| Keywords | sfsafariviewcontroller, custom-tabs, browser-tabs, browser |

## Links

- npm: https://www.npmjs.com/package/cordova-plugin-devonics-tabs
- npm.io page: https://npm.io/package/cordova-plugin-devonics-tabs

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2022-01-13
- 1.0.0 — 2022-01-13

## README

# cordova-plugin-browsertab

Note: This is not an official Google product.

## About

This plugin provides an interface to in-app browser tabs that exist on some
mobile platforms, specifically
[Custom Tabs](http://developer.android.com/tools/support-library/features.html#custom-tabs)
on Android (including the
[Chrome Custom Tabs](https://developer.chrome.com/multidevice/android/customtabs)
implementation), and
[SFSafariViewController](https://developer.apple.com/library/ios/documentation/SafariServices/Reference/SFSafariViewController_Ref/)
on iOS.

## Usage

To open a URL in an in-app browser tab on a compatible platform:

    cordova.plugins.browsertab.openUrl('https://www.google.com');

This plugin is designed to complement cordova-plugin-inappbrowser. No fallback
is triggered automatically, you need to test whether it will succeed, and then
perform your own fallback logic like opening the link in the system browser
instead using cordova-plugin-inappbrowser.

    cordova.InAppBrowser.open('https://www.google.com/', '_system');

Complete example with fallback handling:

    var testURL = 'https://www.google.com';

    document.querySelector("#tabwithfallback").addEventListener('click', function(ev) {
    cordova.plugins.browsertab.isAvailable(function(result) {
        if (!result) {
          cordova.InAppBrowser.open(testURL, '_system');
        } else {
          cordova.plugins.browsertab.openUrl(
              testURL,
              function(successResp) {},
              function(failureResp) {
                error.textContent = "failed to launch browser tab";
                error.style.display = '';
              });
        }
      },
      function(isAvailableError) {
        error.textContent = "failed to query availability of in-app browser tab";
        error.style.display = '';
      });
    });

## Customization

Plugin can be customized by providing parameters during installation.
You can customize i.e. custom tab background color by passing `CUSTOM_TAB_COLOR_RGB` variable in string RGB format:

```bash
cordova plugin add cordova-plugin-browsertab --variable CUSTOM_TAB_COLOR_RGB="#ff0000"
```

List of available parameters:

* **CUSTOM_TAB_COLOR_RGB** - Customize custom tab background color. Pass value as a RGB string `#RRGGBB`.
                            Supported by Android only at the moment.

## Building

Install Cordova if you haven't already:

    npm install -g cordova

Then from the root directory:

    cd demo
    cordova platform add ios
    cordova run ios
    cordova platform add android
    cordova run android

## Development

During development if you want to make changes to the plugin you need to force
a rebuild and add the plugin from source, like so (from the demo directory):

    cordova plugin remove cordova-plugin-browsertab
    cordova plugin add ../plugin

To refresh the platform build:

    cordova platform remove ios
    cordova platform add ios

To set breakpoints, etc, open the project in the code editor:

    cordova platform add ios
    open platforms/ios/BrowserTabDemo.xcworkspace

---
_Source: https://npm.io/package/cordova-plugin-devonics-tabs · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
