gpt4 book ai didi

javascript - navigator.connection.saveData 的目的是什么?

转载 作者:搜寻专家 更新时间:2023-10-31 08:23:46 24 4
gpt4 key购买 nike

我在 navigator.connection.saveData 对象中看到 w3c 站点,但我不明白有什么用?我可以在我的网站上的什么地方使用它?

请任何人都可以解释一下。

最佳答案

根据Network Information API spec ,它看起来像 saveData 属性指示用户是否已请求用户代理减少数据使用量:

The saveData attribute, when getting, returns true if the user has requested a reduced data usage mode from the user agent, and false otherwise.

NOTE

The user may enable such preference, if made available by the user agent, due to high data transfer costs, slow connection speeds, or other reasons.


关于你的第二个问题,

Where can I use it on my website?

According to MDN (和 CanIUse.com ),navigator.connection API 目前仅在 Chrome 版本 61+ 中受支持。它不适用于其他浏览器。

事实上,根据 CanIUse.com,Chrome 仅支持 navigator.connection 上的 downlinkeffectiveTypertt 属性。因此,您可能也无法在 Chrome 上使用 saveData

关于javascript - navigator.connection.saveData 的目的是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49838958/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com