开发者

Javascript and redirect Location: header detection

开发者 https://www.devze.com 2023-03-03 19:42 出处:网络
I have an URL of domain1.com, that redirect to an URL of domain2.com with HTTP Location: header method.

I have an URL of domain1.com, that redirect to an URL of domain2.com with HTTP Location: header method.

Can i, running a javascript page on domain1.com, know the final URL pointing to domain2.com? How?

Thank you in advance开发者_高级运维.


Unfortunately not, most browsers will not give you this level of access and anyone visiting domain1.com will get redirected before executing any code on the page.

Even if you could execute the javascript from domain1.com and make an ajax request to domain1.com, the webbrowser will redirect the ajax request to domain2.com under the hood and return success without giving you any notification of the redirect.

0

精彩评论

暂无评论...
验证码 换一张
取 消