来自同一来源的 iframe 不加载 Cross-Origin-Embedder-Policy:require-corp

iframe from same origin doesn't load with Cross-Origin-Embedder-Policy: require-corp

我有一个带有 iframe 的网页:

<?php
header('Cross-Origin-Opener-Policy: same-origin');
?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
</head>
<body>
    <iframe src="assets/html/menu.htm"></iframe>
</body>
</html>

它在 firefox 中运行良好。

如果我加上

header('Cross-Origin-Embedder-Policy: require-corp');

Firefox 不显示 iframe 内容。错误:

Blocked Page

An error occurred during a connection to <domain>. 

我需要两个 header 来启用 crossOriginIsolated

iframe和主页面同源,为什么firefox添加第二个后不显示iframe内容header?

使用 object 标签代替 iframe 标签解决了问题:

<?php
header('Cross-Origin-Opener-Policy: same-origin');
header('Cross-Origin-Embedder-Policy: require-corp');
?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
</head>
<body>
    <object data="assets/html/menu.htm"></object>
</body>
</html>