gpt4 book ai didi

javascript - 如何在AppBrowser中检索当前所在的url

转载 作者:行者123 更新时间:2023-11-28 09:05:21 24 4
gpt4 key购买 nike

我正在尝试使用 InAppBrowser for Cordova 与 Google 进行 oAuth,并且我需要检索当前 url 以存储访问 token 。我想知道是否有某个命令可以检索用户当前所在的 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

关于javascript - 如何在AppBrowser中检索当前所在的url,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17202456/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com