1666 posts Time is what you desire most, but waste carelessly.
  • Sold between 100 000 and 250 000 dollars
  • Elite Author
  • Bought between 50 and 99 items
  • Referred between 100 and 199 users
  • Grew a moustache for the Envato Movember competition
  • Exclusive Author
  • Has been a member for 4-5 years
  • Microlancer Beta Tester
  • Europe
+1 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.

3650 posts Community Moderator
  • Has been a member for 5-6 years
  • Contributed a Tutorial to a Tuts+ Site
  • Netherlands
  • Community Moderator
  • Microlancer Beta Tester
  • Sold between 10 000 and 50 000 dollars
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Exclusive Author
+4 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?

1666 posts Time is what you desire most, but waste carelessly.
  • Sold between 100 000 and 250 000 dollars
  • Elite Author
  • Bought between 50 and 99 items
  • Referred between 100 and 199 users
  • Grew a moustache for the Envato Movember competition
  • Exclusive Author
  • Has been a member for 4-5 years
  • Microlancer Beta Tester
  • Europe
+1 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?

28 posts
  • Has been a member for 2-3 years
  • Sold between 1 000 and 5 000 dollars
  • Referred between 1 and 9 users
  • Author had a File in an Envato Bundle
  • Exclusive Author
  • Romania
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.

1666 posts Time is what you desire most, but waste carelessly.
  • Sold between 100 000 and 250 000 dollars
  • Elite Author
  • Bought between 50 and 99 items
  • Referred between 100 and 199 users
  • Grew a moustache for the Envato Movember competition
  • Exclusive Author
  • Has been a member for 4-5 years
  • Microlancer Beta Tester
  • Europe
+1 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?

1400 posts
  • Has been a member for 2-3 years
  • Exclusive Author
  • Sold between 10 000 and 50 000 dollars
  • Bought between 10 and 49 items
  • Referred between 1 and 9 users
  • Croatia
OriginalEXE says

You should be able to use top object.

What does

console.log( top.location );

give you?
1666 posts Time is what you desire most, but waste carelessly.
  • Sold between 100 000 and 250 000 dollars
  • Elite Author
  • Bought between 50 and 99 items
  • Referred between 100 and 199 users
  • Grew a moustache for the Envato Movember competition
  • Exclusive Author
  • Has been a member for 4-5 years
  • Microlancer Beta Tester
  • Europe
+1 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.

28 posts
  • Has been a member for 2-3 years
  • Sold between 1 000 and 5 000 dollars
  • Referred between 1 and 9 users
  • Author had a File in an Envato Bundle
  • Exclusive Author
  • Romania
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.

28 posts
  • Has been a member for 2-3 years
  • Sold between 1 000 and 5 000 dollars
  • Referred between 1 and 9 users
  • Author had a File in an Envato Bundle
  • Exclusive Author
  • Romania
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.

1666 posts Time is what you desire most, but waste carelessly.
  • Sold between 100 000 and 250 000 dollars
  • Elite Author
  • Bought between 50 and 99 items
  • Referred between 100 and 199 users
  • Grew a moustache for the Envato Movember competition
  • Exclusive Author
  • Has been a member for 4-5 years
  • Microlancer Beta Tester
  • Europe
+1 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