0

There is a service I'm using which allows me to add Javascript to their pages in a sandboxed iFrame. However, obviously, browsers are not allowing us to read data from the parent document.

So I was wondering if it's possible to listen to a specific Ajax call from inside that iFrame (the Ajax call will be made from the parent document)? Can we somehow see what XMLHTTP requests are being sent?

Ideally with vanilla Javascript.

Radical_Activity
  • 2,618
  • 10
  • 38
  • 70
  • Are the both pages main and iframe on the same domain? And If so are you able to modify JS code on both? – Jan Pfeifer Jan 13 '23 at 09:40
  • Yes, they are both on the same domain. However, I am only able to modify what's inside the iFrame, unfortunately. – Radical_Activity Jan 13 '23 at 09:43
  • 1
    I should be more specific. If they are from same origin you can access parent window object. However the only possible solution is imho https://stackoverflow.com/questions/4406606/can-jquery-listen-to-ajax-calls-from-other-javascript – Jan Pfeifer Jan 13 '23 at 09:47
  • Unfortunately, they are from different origins, so I assume it's not possible then. – Radical_Activity Jan 13 '23 at 10:11

0 Answers0