为什么iframe仅在iOS中是空白的?

有一个 html 页面可以在任何 Windows 和 Android 上正常工作(显示 iframe 的内容)。由 Github Pages 托管。它适用于 iOS 版本12.5.1,但不适用于14.6(Chrome、Safari、Opera上的空白页面)。为什么?

  • src用维基百科试过- 一切正常。问题归结为 iframe 和src应用程序脚本的组合(分别正确打开)
  • 假设问题是http/https根据post混合的。只是http风格http://www.w3.org/2000/svg,我改为https(甚至删除了所有风格)。没有效果。
  • 没有日志错误,只有空白页。似乎试图加载,但中断并停止。我没有要调试的 ios 设备。反馈用户。

如果您有 iOS 14,可以尝试打开此站点。你看到什么空白页或访问错误?

像下一个错误是正确的。它告诉你没有访问。

拒绝在框架中显示“accounts.google.com/...”,因为它将“X-Frame-Options”设置为“DENY”

如果您登录Google 帐户并重试,则 Google 云端硬盘会出错。我在隐身模式下的任何平台上都拥有这一切。不要关注他们。

对空白屏幕/停止加载的情况感兴趣,如下面的截图

iOS 14.6

视窗

<!DOCTYPE html>
<html lang="ru">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Goofy</title>
    <style>
        html, body, iframe { width: 100%; height: 100%; margin: 0; border: 0; }
    </style>
</head>
<body>
    <iframe src="https://script.google.com/macros/s/AKfycbzmAfVL_ozEP69vpYvMo3t1Qlc4orPfk7eV5rWT/exec"></iframe>
</body>
</html>

Apps 脚本呈现页面 XFrameOptionsMode.ALLOWALL

<!DOCTYPE html>
<html lang="ru">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Goofy</title>
    <style>
        html, body, iframe { width: 100%; height: 100%; margin: 0; border: 0; }
    </style>
</head>
<body>
    <iframe src="https://script.google.com/macros/s/AKfycbzmAfVL_ozEP69vpYvMo3t1Qlc4orPfk7eV5rWT/exec"></iframe>
</body>
</html>

以上是为什么iframe仅在iOS中是空白的?的全部内容。
THE END
分享
二维码
< <上一篇
下一篇>>