2013-06-19 20 views
1

我正在嘗試使用InAppBrowser for Google對Google進行oAuth,並且我需要檢索當前URL以存儲訪問令牌。我想知道是否有某個命令來檢索用戶所在的當前URL。 我的代碼:如何檢索URL inAppBrowser目前在

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); 

回答

0

我面臨同樣的問題,使用這樣的事情

this.document.location.href 
解決