Skip to content

add allow same origin on embeded item #842

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
- Fixed block editor button 'saved' instead of 'save' (MAD-1475)
- Fixed marking canvas as incomplete not marking manifest as incomplete (MAD-1516)
- Fixed CORS errors in embed item block

## [v2.2.7](https://github.com/digirati-co-uk/madoc-platform/compare/v2.2.6...v2.2.7)

Expand Down
11 changes: 9 additions & 2 deletions services/madoc-ts/src/frontend/site/blocks/EmbedItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,14 @@ export const EmbedItem: React.FC<{
}> = ({ link, height, width }) => {
return (
<EmbedWrapper>
<iframe src={link} height={height} width={width} loading="lazy" referrerPolicy="no-referrer" sandbox="allow-scripts" />
<iframe
src={link}
height={height}
width={width}
loading="lazy"
referrerPolicy="no-referrer"
sandbox="allow-scripts allow-same-origin"
/>
</EmbedWrapper>
);
};
Expand All @@ -30,7 +37,7 @@ blockEditorFor(EmbedItem, {
width: '400',
},
editor: {
link: { type: 'text-field', label: 'src or link' },
link: { type: 'text-field', label: 'src or link', description: 'paste an embed src/link without quotes' },
height: { type: 'text-field', label: 'height (px)' },
width: { type: 'text-field', label: 'width (px)' },
},
Expand Down
1 change: 1 addition & 0 deletions services/madoc-ts/translations/en/madoc.json
Original file line number Diff line number Diff line change
Expand Up @@ -1190,6 +1190,7 @@
"secondButton": "secondButton",
"secondButtonLink": "secondButtonLink",
"size": "size",
"some help text": "some help text",
"src or link": "src or link",
"summary": "summary",
"switch to the main revision": "switch to the main revision",
Expand Down
Loading