I’d like to break out of the iframe of the fullscreen preview, how can I do that? It’s breaking something with facebook JS and renders some other scripts on the page useless not to mention the responsive features are not working that way. I tried http://themeforest.net/forums/thread/introducing-item-switcher/42612 but it doesn’t seem to work.
When I try to set/see parent.location.href I get Error: Permission denied to access property ‘href’ – maybe due to the cross domain.
It doesn’t want to work for me:
Uncaught SecurityError: Blocked a frame with origin “xx” from accessing a frame with origin “http://codecanyon.net”. Protocols, domains, and ports must match.
Should I try with an empty page with just that code to see if something else on the site is breaking it or that’s not possible?
You can’t change the parent url that would be very unsafe.
Maybe you need to send a custom header or use postMessage. Hopefully a staff member can shed some light on this.
Aren’t custom headers only for the page that is contained within the iframe? I keep seeing postMessage as a possible solution, but doesn’t it need control over the page with the iframe, to work?
You should be able to use top object.
console.log( top.location );give you?
It shows up as DOMException in Chrome console.
It returns the proper location object in Firefox. But as soon as I start to access its properties like
I get errors.
I saw some themes months ago where that bar was removed, but I cant find any of them now.
If you anyone finds something maybe we can message the author or do some reverse engineering.
You cant change the parent location from within the iframe, its a basic crossdomain restriction.
A postMessage solution seems to be the right one, but it would need a parent frame response. So an API would exist.