1

I have issue with accessing iframe that is inside another iframe. I was trying something like this:

window.getElementById("parentIframe").contentWindow.document.getElementById("childIframe").contentWindow But id did not worked (in my browser console i get something like "Inaccessible")

I want to know if there is a way to access nested iframe window object ?

To make things harder top parent window is on different port then iframe content. (So we have CORS to block any access from child iframe content) Another issue is that i have no way to modify middle iframe content. I can only embed another iframe inside of it.

My question is about accessing iframe that is inside another iframe NOT ABOUT CORS reletaed issues.

Maxvt
  • 311
  • 4
  • 11
  • my question is about accessing iframe embeded inside another iframe not about CORS issue. – Maxvt Nov 23 '17 at 12:46
  • @SuperUser Please read my edited question and tell my if it is duplicate – Maxvt Nov 23 '17 at 12:55
  • possible duplicate https://stackoverflow.com/questions/15343955/jquery-select-element-inside-iframe-which-is-inside-an-iframe – Super User Nov 23 '17 at 12:58
  • @SuperUser Where in my question I am asking about jQuery ??? – Maxvt Nov 23 '17 at 12:58
  • You need to access the parent frame ? parent.document.getElementById – PhilMaGeo Nov 23 '17 at 13:07
  • @PhilMaGeo I want to access child window of Iframe that is inside of another iframe from top page so we have something like this – Maxvt Nov 23 '17 at 13:14
  • 1
    The opposite is easy. For your concern maybe take a look at the web messaging and window.postMessage. I'm not fluent on the subject but it seems interesting – PhilMaGeo Nov 23 '17 at 13:25
  • @PhilMaGeo thanks for quick answer. I am currently looking on postMessage. I asked this question to find out if someone have better solution. – Maxvt Nov 23 '17 at 13:27

0 Answers0