How to use the cordova-plugin-inappbrowser.inappbrowser function in cordova-plugin-inappbrowser

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 12 months ago

Package Health Score

67 / 100
Full package analysis

Popular cordova-plugin-inappbrowser functions