Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/399.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript window.postMessage到原点为空的iframe_Javascript_Iframe_Postmessage - Fatal编程技术网

Javascript window.postMessage到原点为空的iframe

Javascript window.postMessage到原点为空的iframe,javascript,iframe,postmessage,Javascript,Iframe,Postmessage,出于测试目的,我正在编写嵌套IFrame: 主窗口>iframe>iframe 两个iFrame都有一个Blob as src,sandbox属性,仅带有“allow scripts” 从第一个iframe到主窗口的postMessage很容易,但是既然原点为“null”,如何从第二个iframe到第一个iframe的postMessage呢 当然,如果我将第二个postMessage参数设置为“*”,这是有效的,但这是一种非常糟糕的做法 有线索吗

出于测试目的,我正在编写嵌套IFrame:

主窗口>iframe>iframe

两个iFrame都有一个Blob as src,sandbox属性,仅带有“allow scripts”

从第一个iframe到主窗口的postMessage很容易,但是既然原点为“null”,如何从第二个iframe到第一个iframe的postMessage呢

当然,如果我将第二个postMessage参数设置为“*”,这是有效的,但这是一种非常糟糕的做法

有线索吗