How can I prevent an iframe from accessing parent frame?

前端 未结 2 1204
旧时难觅i
旧时难觅i 2021-02-14 06:59

I\'ve got a page with an iframe. The page and the source of the iframe are in different domains. Inside the iframe I\'m using a rich text editor called CuteEditor (which has tur

2条回答
  •  醉酒成梦
    2021-02-14 07:21

    You shouldn't need to worry about that happening.

    The only way iframes can talk cross-origin is with postMessage, and that's only possible if you're listening to that domain directly.

    https://developer.mozilla.org/en/DOM/window.postMessage

提交回复
热议问题