1781 posts Time is what you desire most, but waste carelessly.
  • Has sold $250,000+ on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has been part of the Envato Community for over 5 years
  • Sells items exclusively on Envato Market
+5 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.

3785 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 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?

1781 posts Time is what you desire most, but waste carelessly.
  • Has sold $250,000+ on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has been part of the Envato Community for over 5 years
  • Sells items exclusively on Envato Market
+5 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.

1781 posts Time is what you desire most, but waste carelessly.
  • Has sold $250,000+ on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has been part of the Envato Community for over 5 years
  • Sells items exclusively on Envato Market
+5 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?

1509 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
+2 more
OriginalEXE says

You should be able to use top object.

What does

console.log( top.location );

give you?
1781 posts Time is what you desire most, but waste carelessly.
  • Has sold $250,000+ on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has been part of the Envato Community for over 5 years
  • Sells items exclusively on Envato Market
+5 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.

1781 posts Time is what you desire most, but waste carelessly.
  • Has sold $250,000+ on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has been part of the Envato Community for over 5 years
  • Sells items exclusively on Envato Market
+5 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…

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by