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

unblock iframe doc from accessing localstorage n cookies. fixes

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

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

@ -955,11 +955,11 @@ export default class ContentWrap extends Component {
/> />
) : ( ) : (
<iframe <iframe
src={`./indexpm.html`} src={`${PREVIEW_FRAME_HOST}/preview.html`}
ref={el => (this.frame = el)} ref={el => (this.frame = el)}
frameborder="0" frameborder="0"
id="demo-frame" 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" allow="accelerometer; camera; encrypted-media; display-capture; geolocation; gyroscope; microphone; midi; clipboard-read; clipboard-write; web-share"
allowpaymentrequest="true" allowpaymentrequest="true"
allowfullscreen="true" allowfullscreen="true"

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