Cordova Plugin Browser - unable to figure out how it works

I want to open some of my external links with “chrome custom tab” and for this purpose I have installed a cordova plugin - “cordova-plugin-browser” (Github link - https://github.com/chemerisuk/cordova-plugin-browser)

So in my desired link, I am doing this -
<a href="#" class="external" onclick="openLink($myurl)">View Details</a>

AND then in my app.js, I am doing this -
//open in chrome custom tab
function openLink(url){
var url = url;
cordova.plugins.browser.open(url);
}

Clicking the link does nothing. Actually I am unable to figure out how to use the plugin/or initiate the plugin when link is clicked.
Very less help is described in the plugin page. It says, to open a link in browser activity do - cordova.plugins.browser.open("https://google.com");

Please suggest correct way to do it.

  1. Install:
    cordova plugin add cordova-plugin-inappbrowser
  2. <a href="#" class="external" @click="openUrl('https://mysite.com')">...</a>
  3. in router component methods:
openUrl: function (url) {
window.open(url, '_system');
}

But “cordova-plugin-inappbrowser” is not a chrome custom tab, it 's like a custom made browser. I need to open external link only on chrome custom tab. Why? because those link (pages) have adsense-ad and as per adsense policy, adsense ad can be shown on pages if it is opened in chrome custom tabs. Opening in web-view or any custom browser inside the app is against the adsense policy.

It is not true

Read my post

Maybe you need this https://github.com/google/cordova-plugin-browsertab

@nolimits4web Sir, I tried installing it but since the plugin is too old, it does not support cordova android > 7.
Shows error while installing -

  • Plugin doesn’t support this project’s cordova-android version. cordova-android: (tried with 7 & 8), failed version requirement: <6.3.0 *

@shastox

I understand, but I need chrome custom tab. I have to follow Adsense program policies. It says-

AdSense for content (AFC) and Ad Exchange (AdX) display ads are not supported through all WebView technologies. App developers wishing to monetize by publishing AFC and AdX display ads through a WebView must use one of the following supported viewing frames:

Then maybe this one https://github.com/Qbix/cordova-plugin-browsertab ?
But not sure, you have pretty specific case, maybe some who used it can help

@nolimits4web Thank you sir, I will try this one.

Sir, my one request. please visit this link and try to understand what developer is suggesting to make it - https://github.com/chemerisuk/cordova-plugin-browser

Since I am not an expert, I am finding difficulties to understand the correct way (may be). I believe you can understand it and can suggest me what to write in my app.js

Try this well maintained plugin

This plugin supports SafariViewContoller for iOS and Chrome Custom Tabs for Android respectively.