$cordovaInAppBrowser打开显示地址栏的url

$cordovaInAppBrowser打开显示地址栏的url,cordova,ionic-framework,cordova-plugins,inappbrowser,Cordova,Ionic Framework,Cordova Plugins,Inappbrowser,当我单击url以使用$cordovaInAppBrowser.open打开url(url,'.\u blank',options)打开InAppBrowser时,它会让我退出url,显示奇怪的行为 这是我的密码 var options = { location: 'yes', clearcache: 'yes', toolbar: 'no' }; $cordovaInAppBrowser.open(url, '_blank'

当我单击url以使用
$cordovaInAppBrowser.open打开url(url,'.\u blank',options)
打开InAppBrowser时,它会让我退出url,显示奇怪的行为

这是我的密码

    var options = {
        location: 'yes',
        clearcache: 'yes',
        toolbar: 'no'
    };
    $cordovaInAppBrowser.open(url, '_blank', options)
    .then(function (event) {
        // success
    })
    .catch(function (event) {
        // error
    });

您可以尝试以下选项

iOS:

安卓:

cordova.InAppBrowser.open(yourURL, '_blank', 'location=no');

在你的例子中,
cordova.InAppBrowser
$cordovaInAppBrowser

我可以在Android和ios上使用这段代码来解决这个问题

  self.viewLink = function (viewUrl) {

        var url = (viewUrl.match('http')) ? viewUrl : 'http://' + viewUrl;
        var options = {
            location: 'no',
            clearcache: 'yes',
            toolbar: 'yes',
            closebuttoncaption: 'Done'
        };
        $cordovaInAppBrowser.open(url, '_blank', options)
        .then(function (event) {
            // success
        })
        .catch(function (event) {
            // error
        });
        return false;
    }
对我来说,它工作得很好。希望对某些人来说它能起作用

  self.viewLink = function (viewUrl) {

        var url = (viewUrl.match('http')) ? viewUrl : 'http://' + viewUrl;
        var options = {
            location: 'no',
            clearcache: 'yes',
            toolbar: 'yes',
            closebuttoncaption: 'Done'
        };
        $cordovaInAppBrowser.open(url, '_blank', options)
        .then(function (event) {
            // success
        })
        .catch(function (event) {
            // error
        });
        return false;
    }