Make WordPress Core

Opened 11 years ago

Closed 11 years ago

#33663 closed defect (bug) (wontfix)

Live Customizer Not working on Websites with No Iframe

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

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
11 years ago

  • Keywords reporter-feedback added
  • Version 4.2.2 → 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
11 years ago

  • Component Administration → Customize

#3 @surjithctly
11 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
11 years ago

  • Keywords reporter-feedback removed
  • Milestone Awaiting Review
  • Resolution → wontfix
  • Status new → 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.