问题描述
我只是有关窗口的信息。 navigator.userAgent:
I just read on MDN about window.navigator.userAgent:
我在网上找不到任何其他重要参考确认此声明。用户代理信息由于各种原因(分析,特定浏览器中的错误修复......)被许多公司广泛使用。虽然我明白人们应该使用特征检测而不是嗅探它,但这些信息会消失似乎令人难以置信。
I am not finding any other significant reference on the web confirming this statement. User agent information are widely used by many companies for various reasons (analytics, bug fixes in specific browser ...). While I understand that one should use feature detection over ua sniffing it just seems incredible that this information would go away.
它真的消失了还是仅仅是一个Mozilla的东西?
Is it really going away or is it just a Mozilla thing?
如果有,是否有替代品?
If so, is there a replacement for it?
推荐答案
现在,弃用通知似乎已经消失。它已被删除在第一次提出此问题后一年,评论如下:
The deprecation notice seems to be gone now. It was removed yesterday, over a year after this question was first asked, with the following comment:
没有弃用此属性,因此确认属性不是走开了。当然,这是一个废话,容易欺骗,但不推荐使用与弃用不同。正如您所注意到的,太多的作者和组织依赖于此属性,因为它只是简单地被推测出来并从实现中删除。
The WHATWG Living standard hasn't deprecated this property, so that confirms that the property isn't going away. Sure, it's a crapshoot and easily spoofed, but "not recommended for use" is not the same as "deprecated". As you note, too many authors and organizations depend on this property for it to be simply specced out of existence and removed from implementations.
也许对这个词的含义感到困惑弃用是首先导致弃用通知的原因。顺便说一句,文章本身仍然被错误地标记为已弃用。
Perhaps confusion over the meaning of the word "deprecated" is what resulted in the deprecation notice in the first place. The article itself is still incorrectly tagged "Deprecated", by the way.
请注意,Mozilla不对MDN文档的贡献负责。社区是。与任何其他社区策划的非官方知识库(包括本网站)一样,不要将其信息视为福音,总是交叉引用等(正如您在此处所做的那样)。
Note that Mozilla is not responsible for contributions to the MDN docs. The community is. And as with any other community-curated, unofficial knowledge base (including this very site), don't treat its information as gospel, always cross-reference, etc (as you have done here).
这篇关于window.navigator.userAgent真的会被弃用吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!