Cookie權限導致iframe錯誤
P粉447002127
P粉447002127 2024-01-21 16:00:06
0
1
599

我目前在我的網頁中使用一個簡單的 iframe,使用 bootstrap 來適應小螢幕(=you tube Short)和大螢幕(=普通橫向影片):

<div class="container d-none d-md-block" style="max-width:1000px;height:30%;">

      <iframe width="1000" height="550"
        src="https://www.you tube-nocookie.com/embed/0...?&mute=1&autoplay=1&encrypted-media=1" allow="autoplay; fullscreen;">
    </iframe>

  </div>

  <div class="container .d-block d-md-none" style="width:95%;">

      <iframe width="400" height="500"
        src="https://www.you tube-nocookie.com/embed/G...?&mute=1&autoplay=1&encrypted-media=1" allow="autoplay; fullscreen;">
    </iframe>

  </div>

</div>

我有一條警告/錯誤訊息:

權限策略標頭錯誤:無法辨識的功能: 「ch-ua-形狀因子」。

經查,似乎與螢幕尺寸有關: https://wicg.github.io/ua-client-hints/

但是,如果我刪除螢幕尺寸的類,例如“d-none d-md-block”,仍然會出現相同的訊息(可能是由於父螢幕尺寸配置所致)。

除此之外,如果我刪除所有 iframe 選項並且使用 www.you tube.com 而不是 www.you tube-nocookie.com,也會出現該錯誤。

如何解決這個問題?

P粉447002127
P粉447002127

全部回覆(1)
P粉135799949

我在包含嵌入式 YouTube 影片的頁面上收到了同樣的警告,我更深入地了解了情況,只是發現實際上來自他們這邊,因為違反規則的元素位於嵌入內部。 所以我認為忽略警告的建議是最好遵守的。

熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板
關於我們 免責聲明 Sitemap
PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!