Make WordPress Core

Opened 9 years ago

Closed 9 years ago

#33663 closed defect (bug) (wontfix)

Live Customizer Not working on Websites with No Iframe

Reported by: surjithctly's profile surjithctly Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.4
Component: Customize Keywords:
Focuses: Cc:

Description

When checking the Live customizer option, The page keeps refreshing. I've set a code in htaccess to avoid loading websites in iframe.

Because of that the customizer keeps refreshing. There are many websites disallow iframe use, so the customizer should work on that kind of websites too.

Change History (4)

#1 @westonruter
9 years ago

  • Keywords reporter-feedback added
  • Version changed from 4.2.2 to 3.4

@surjithctly: thanks for the report.

What does your .htaccess look like specifically?

If you have frame-busting code in your site, you'll need to explicitly disable it if the site is to be viewed in the Customizer. Specifically, it should be omitted if is_customize_preview() returns true.

#2 @westonruter
9 years ago

  • Component changed from Administration to Customize

#3 @surjithctly
9 years ago

Sorry for the confusion. It was not in the htaccess. Instead its a Javascript snippet. See below.

(function(window) {
  if (window.location !== window.top.location) {
    window.top.location = window.location;
  }
})(this);

#4 @westonruter
9 years ago

  • Keywords reporter-feedback removed
  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

OK, so what you need to do then is simply change this to:

(function( window ) {
  var isCustomizePreview = ( typeof wp !== 'undefined' && typeof wp.customize !== 'undefined' );
  if ( ! isCustomizePreview && window.location !== window.top.location ) {
    window.top.location = window.location;
  }
})( this );
Note: See TracTickets for help on using tickets.