views:

36

answers:

2

I am getting an error when my app is being embedded in an iframe that reads

Permission denied for https://myapp.com to call method Location.toString on http://otherhost.com

I am not getting a stack trace, line number, or file where this occurring in any of the browsers. How could I figure out where this problem is coming from?

A: 

This error is happening because of the same-origin policy. You can't run any Javascript from a non-extension source inside of a cross domain iframe. That is, an Iframe that is from a different domain than the main page's.

Alex
What sort of Javascript is it that can't be run? External scripts? Or just javascript that is trying to access `window.location`?
trobrock
No javascript, with the exception of special-permission browser extensions, can be run within cross-domain iframes.
Alex
I am able to run Javascript from within the iframe with no problem. I have in some of the code something that does things with window.location and my guess was that it was one of those that was causing the problem
trobrock
A: 

I determined that this error was coming from some JS tracking code that was including some flash to do it's tracking inside the iFrame, turned off the flash portion and this error disappeared

trobrock