Skip to content

Commit 23bd92d

Browse files
committed
fix: add sandbox check in iframe
1 parent dcd817a commit 23bd92d

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/Shared/Components/IframeContainer/IframeElement.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ const IframeElement = ({ URL, width, height, title, maxHeight, maxWidth }: Ifram
5252
height={Math.min(maxHeight, height)}
5353
className="dc__no-border"
5454
onError={handleError}
55+
sandbox="allow-same-origin allow-scripts"
56+
referrerPolicy="no-referrer"
5557
/>
5658
</div>
5759

@@ -74,7 +76,14 @@ const IframeElement = ({ URL, width, height, title, maxHeight, maxWidth }: Ifram
7476
</div>
7577
<div className="flex px-16 py-8 h-100">
7678
{/* eslint-disable-next-line jsx-a11y/iframe-has-title */}
77-
<iframe src={URL} width="100%" height="100%" className="dc__no-border" />
79+
<iframe
80+
src={URL}
81+
width="100%"
82+
height="100%"
83+
className="dc__no-border"
84+
sandbox="allow-same-origin allow-scripts"
85+
referrerPolicy="no-referrer"
86+
/>
7887
</div>
7988
</div>
8089
</VisibleModal>

0 commit comments

Comments
 (0)