1
0
mirror of https://github.com/chinchang/web-maker.git synced 2025-04-21 03:01:52 +02:00

unblock iframe doc from accessing localstorage n cookies. fixes #558

This commit is contained in:
Kushagra Gour 2024-05-08 13:35:40 +05:30
parent 5fc38cfa28
commit b51edadc6d
3 changed files with 4 additions and 4 deletions

View File

@ -15,6 +15,6 @@ window.addEventListener('message', e => {
// Recieving from preview iframe
if (e.data && e.data.logs) {
window.opener.postMessage(e.data, '*');
(window.opener || window.top).postMessage(e.data, '*');
}
});

View File

@ -955,11 +955,11 @@ export default class ContentWrap extends Component {
/>
) : (
<iframe
src={`./indexpm.html`}
src={`${PREVIEW_FRAME_HOST}/preview.html`}
ref={el => (this.frame = el)}
frameborder="0"
id="demo-frame"
sandbox="allow-downloads allow-forms allow-modals allow-pointer-lock allow-popups allow-presentation allow-scripts allow-top-navigation-by-user-activation"
sandbox="allow-same-origin allow-downloads allow-forms allow-modals allow-pointer-lock allow-popups allow-presentation allow-scripts allow-top-navigation-by-user-activation"
allow="accelerometer; camera; encrypted-media; display-capture; geolocation; gyroscope; microphone; midi; clipboard-read; clipboard-write; web-share"
allowpaymentrequest="true"
allowfullscreen="true"

View File

@ -15,6 +15,6 @@ window.addEventListener('message', e => {
// Recieving from preview iframe
if (e.data && e.data.logs) {
window.opener.postMessage(e.data, '*');
(window.opener || window.top).postMessage(e.data, '*');
}
});