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 #558
This commit is contained in:
@ -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, '*');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user