File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -110,7 +110,7 @@ const md5 = require( 'md5' );
110110 * @return boolean
111111 */
112112 function isSiteEditor ( ) {
113- return typeof pagenow === 'string' && pagenow === 'site-editor' ;
113+ return document . querySelectorAll ( 'iframe[name="editor-canvas"]' ) . length > 0 ;
114114 }
115115
116116 /**
@@ -758,9 +758,7 @@ const md5 = require( 'md5' );
758758
759759 if (
760760 isBlockInQueryLoop ( clientId ) ||
761- isSiteEditor ( ) ||
762- isiFramedMobileDevicePreview ( ) ||
763- isEditingTemplate ( )
761+ isSiteEditor ( )
764762 ) {
765763 restrictMode ( [ 'preview' ] ) ;
766764 } else {
@@ -783,9 +781,7 @@ const md5 = require( 'md5' );
783781 const blockType = getBlockType ( name ) ;
784782 const forcePreview =
785783 isBlockInQueryLoop ( clientId ) ||
786- isSiteEditor ( ) ||
787- isiFramedMobileDevicePreview ( ) ||
788- isEditingTemplate ( ) ;
784+ isSiteEditor ( ) ;
789785 let { mode } = attributes ;
790786
791787 if ( forcePreview ) {
You can’t perform that action at this time.
0 commit comments