mirror of
https://github.com/strapi/strapi.git
synced 2025-11-02 19:04:38 +00:00
fix: add origin to preview message (#23059)
* fix: add origin to preview message * Update packages/core/content-manager/admin/src/preview/components/PreviewHeader.tsx Co-authored-by: markkaylor <mark.kaylor@strapi.io> --------- Co-authored-by: markkaylor <mark.kaylor@strapi.io>
This commit is contained in:
parent
614aaf36aa
commit
4ebc804985
@ -185,7 +185,11 @@ const UnstablePreviewHeader = () => {
|
||||
document,
|
||||
meta,
|
||||
onPreview: () => {
|
||||
iframeRef?.current?.contentWindow?.postMessage({ type: 'strapiUpdate' });
|
||||
iframeRef?.current?.contentWindow?.postMessage(
|
||||
{ type: 'strapiUpdate' },
|
||||
// The iframe origin is safe to use since it must be provided through the allowedOrigins config
|
||||
new URL(iframeRef.current.src).origin
|
||||
);
|
||||
},
|
||||
} satisfies DocumentActionProps;
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ import {
|
||||
Form as FormContext,
|
||||
} from '@strapi/admin/strapi-admin';
|
||||
import { Box, Flex, FocusTrap, IconButton, Portal } from '@strapi/design-system';
|
||||
import { ArrowLeft } from '@strapi/icons';
|
||||
import { ArrowLineLeft } from '@strapi/icons';
|
||||
import { useIntl } from 'react-intl';
|
||||
import { useLocation, useParams } from 'react-router-dom';
|
||||
import { styled } from 'styled-components';
|
||||
@ -47,7 +47,7 @@ const [PreviewProvider, usePreviewContext] = createContext<PreviewContextValue>(
|
||||
* PreviewPage
|
||||
* -----------------------------------------------------------------------------------------------*/
|
||||
|
||||
const AnimatedArrow = styled(ArrowLeft)<{ isSideEditorOpen: boolean }>`
|
||||
const AnimatedArrow = styled(ArrowLineLeft)<{ isSideEditorOpen: boolean }>`
|
||||
will-change: transform;
|
||||
rotate: ${(props) => (props.isSideEditorOpen ? '0deg' : '180deg')};
|
||||
transition: rotate 0.2s ease-in-out;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user