如何检索url inAppBrowser当前在

How to retrieve the url inAppBrowser currently in

本文关键字:inAppBrowser url 何检索 检索      更新时间:2023-09-26

我正在尝试使用InAppBrowser for Cordova与Google进行oAuth,我需要检索当前url以存储访问令牌。我想知道是否有一个特定的命令来检索用户所在的当前URL。我的代码:

window.open( authUri, { showLocationBar : false } );
window.open( authUri, { showLocationBar : false } ).addEventListener( 'loadstart', function() {
    if ( event.url.indexOf( "code=" ) != -1 )
    {
        alert( "hey" );
        var lel = URL;
    }
});
window.open( lel, { showLocationBar : false } ).addEventListener( 'loadstart', $this.onAuthUrlChange );
window.open( lel, { showLocationBar : false } ).addEventListener( 'loadstop', $this.onAuthClose );

我遇到了同样的问题,并使用这样的代码来解决

this.document.location.href