0

I want to be able to check the current content of an iframe tag.

Example

<iframe src="bing.com"> </iframe>

I want to be able to check what the user has clicked inside the iframe (in this content probably their search query) and see the current URL they are accessing inside the iframe.

Is this even possible? And if so, how can I accomplish it. Thanks in advance

Scott Marcus
  • 64,069
  • 6
  • 49
  • 71
Inigo Mantoya
  • 641
  • 2
  • 9
  • 14
  • If the content is from a different domain, that is not possible - Same Origin Policy. – CBroe Jul 22 '17 at 17:04
  • Check out this post which I read when I faced a similar issue: https://stackoverflow.com/questions/3076414/ways-to-circumvent-the-same-origin-policy and its accepted answer in particular – umop apisdn Jul 22 '17 at 17:04
  • 1
    @CBroe It is possible, it's just that the servers will need explicit permission ["Cross Origin Request Sharing"](https://www.w3.org/TR/cors/) – Scott Marcus Jul 22 '17 at 17:06
  • Thanks everyone for the help – Inigo Mantoya Jul 22 '17 at 17:44

0 Answers0