how to inject the javascript code into iframe? [cl

2019-09-06 08:14发布

问题:

I have an iframe(src is google.com)..I want to inject the javascript code for find the list of anchor tags present in the iframe from parent to iframe.Is it possible to inject the code?

Thanks.

回答1:

It is not possible because of the same-origin policy.

See http://en.wikipedia.org/wiki/Same_origin_policy.

And because you do not have access the Google's server configuration, you won't find any help here either: Ways to circumvent the same-origin policy .