使用window.navigator-不匹配HTTP标头时显示不正确的用户代理

发布于 2025-02-11 22:43:20 字数 482 浏览 0 评论 0 原文

我使用Chrome Extention切换用户代理,这是http标头中的用户代理字符串: “在此处输入图像说明”

这是window.navigator.useragent的控制台日志。他们为什么不一样?如何以JavaScript或Angular中的HTTP标头中的“用户”方式进行编程?

I switch user-agent using the chrome extention and here is the user-agent string in the http header: enter image description here

Here is a console log of the window.navigator.userAgent. why aren't they the same? How can I programmatically get the userAgent shown in the http header in Javascript or Angular? enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

如若梦似彩虹 2025-02-18 22:43:20

我不使用“ Chrome的用户代理切换器”扩展,而是在Chrome Inspector中的“网络条件”选项卡中更改了“用户代理”。有效: https:/ doc/devtools/device-mode/Override-user-agent/

Instead of using the "user-agent switcher for chrome" extention, I changed the " user agent " in the network conditions tab in the chrome inspector. that worked: https://developer.chrome.com/docs/devtools/device-mode/override-user-agent/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文