1708 posts Time is what you desire most, but waste carelessly.
  • Has sold $125,000+ on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has been part of the Envato Community for over 4 years
  • Sells items exclusively on Envato Market
+6 more
Firsh says

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.

3701 posts Community Moderator
  • Helps us moderate the forums
  • Contributed a tutorial on Tuts+
  • Located in Netherlands
  • Made it to the Authors' Hall of Fame
+9 more
Joost Volunteer moderator says

I believe the classic approach is top.location = self.location.href;, but I’m not quite sure about the security implications, or is this even possible..

Has anyone done this succesfully?

1708 posts Time is what you desire most, but waste carelessly.
  • Has sold $125,000+ on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has been part of the Envato Community for over 4 years
  • Sells items exclusively on Envato Market
+6 more
Firsh says

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?

32 posts
  • Has referred 1+ members
  • Has sold $5,000+ on Envato Market
  • Has been part of the Envato Community for over 2 years
  • Had an item featured in an Envato Bundle
+2 more
nachothemes says

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.

1708 posts Time is what you desire most, but waste carelessly.
  • Has sold $125,000+ on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has been part of the Envato Community for over 4 years
  • Sells items exclusively on Envato Market
+6 more
Firsh says

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?

1476 posts
  • Has referred 1+ members
  • Has sold $10,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Made it to the Authors' Hall of Fame
+3 more
OriginalEXE says

You should be able to use top object.

What does

console.log( top.location );

give you?
1708 posts Time is what you desire most, but waste carelessly.
  • Has sold $125,000+ on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has been part of the Envato Community for over 4 years
  • Sells items exclusively on Envato Market
+6 more
Firsh says

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

console.log(top.location.href); 

I get errors.

32 posts
  • Has referred 1+ members
  • Has sold $5,000+ on Envato Market
  • Has been part of the Envato Community for over 2 years
  • Had an item featured in an Envato Bundle
+2 more
nachothemes says

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.

32 posts
  • Has referred 1+ members
  • Has sold $5,000+ on Envato Market
  • Has been part of the Envato Community for over 2 years
  • Had an item featured in an Envato Bundle
+2 more
nachothemes says

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.

1708 posts Time is what you desire most, but waste carelessly.
  • Has sold $125,000+ on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has been part of the Envato Community for over 4 years
  • Sells items exclusively on Envato Market
+6 more
Firsh says

I still see them all the time! Dtbaker does it very well, I already messaged him. Yes that’s my concern too that you need something from the Envato side to listen to the postMessage…

by
by
by
by
by
by