I am looking for the way to call the javascript method inside with a different domain iframe.
For example, app.facebook.com contains iframe yyy.com inside.
I would like to call the yyyMethod() inside iframe yyy.com.
app.facebook.com
|__iframe src="yyy.com" name="yyy"
|__yyyMethod();
- I tried window.frames["yyy"].contentWindow.yyyMethod(), but it return exception saying that we could not call method across domain.
Restrictions are
1) Adding/Modifying content in both app.facebook.com and yyy.com are prohibited, since I am not the site owner.
2) Execute from browser javascript console is one way to do, but I want to write plug the yyyMethod() caller with some javascipt code. Therefore, execute from browser javascript console may not be a good idea.
Any idea how to do this ? Not sure whether we can call from the chrome extension, bookmarklet, or something else ??