开发者

Getting iframe URL location from parent document

开发者 https://www.devze.com 2023-01-20 19:28 出处:网络
I have document with iframe. I have no problem setting iframe\'s location by using this: $(\'#iframe\').attr(\'src\', \'http://www.another-domain-site.com\');

I have document with iframe. I have no problem setting iframe's location by using this:

  $('#iframe').attr('src', 'http://www.another-domain-site.com');

When user navigates a few pages in that iframe, then I want to get back URL where he ends up. But when the SRC attribute of the iframe never changes from what I initially have set.

Is there a way how to get iframe's location when it changes or there is no way aroun开发者_C百科d same-domain policy ?

I have one more question on my mind considering question above - is there a way how browser could ask user for permission to allow this type of requests ? The same way Chrome extensions ask for extended permissions ?


I am sorry, after more searching I've found someone ask exactly same question here and the short answer is: "Its not possible".

0

精彩评论

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

关注公众号