javascript - How to extract iframe's redirect url? -
i searched alot didn't find(or didn't understand solutions) im looking for. want extract redirect url iframe. example, embedded xyz.com in iframe , when iframe gets loaded on client browser, gets redirected example.com/.
i want extract redirected url, i.e example.com/
thanks
if iframe on same domain, can select iframe, select contents of iframe, select has redirect url, use window.location redirect:
var iframe = document.getelementbyid('iframeid'); var innerdoc = iframe.contentdocument || iframe.contentwindow.document; var redirect = innerdoc.getelementbyid('redirecturl').innerhtml; window.location = redirect; if it's not, won't able contents due cross site scripting
Comments
Post a Comment