How to use cordova-plugin-inappbrowser - 1 common examples

To help you get started, we’ve selected a few cordova-plugin-inappbrowser examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github MobileChromeApps / cordova-plugin-chrome-apps-identity / identity.js View on Github external
function launchInAppBrowser(authURL, interactive, callback) {
    var openInAppBrowser = require('cordova-plugin-inappbrowser.inappbrowser');
    var oAuthBrowser = openInAppBrowser(authURL, '_blank', 'hidden=yes');
    var success = false;
    var timeoutid;
    oAuthBrowser.addEventListener('loadstart', function(event) {
        if (success)
            return;
        if (timeoutid)
            timeoutid = clearTimeout(timeoutid);
        var newLoc = event.url;

        // When the location address starts with our redirect URL, we're done.
        if (newLoc.indexOf(exports.getRedirectURL()) === 0) {
            success = true;
        }

        if (success) {
            oAuthBrowser.close();

cordova-plugin-inappbrowser

Cordova InAppBrowser Plugin

Apache-2.0
Latest version published 4 months ago

Package Health Score

71 / 100
Full package analysis

Popular cordova-plugin-inappbrowser functions