浏览器中的不同用户代理
我注意到一些浏览器通过内置开发功能允许您选择不同的用户代理。
这是否意味着他们改变了渲染引擎?
举例来说,如果我将 Safari 的用户代理设置为 Internet Explorer,那么渲染引擎是否会从 webkit 更改为 trident?
目前我的 Mac 上安装了 Safari、Chrome、Firefox 和 iCab。我想它们会比内置的用户代理功能更好地代表不同的引擎。 但是,除非您采用虚拟机或双引导方式,否则您只能安装每个版本的 1 个版本。
那么你的建议是什么?运行多个虚拟机,当然需要购买额外的许可证才能合法运行。或者坚持使用内置的用户代理功能,这可以提供足够好的差异交互?
干杯杰夫
I have noticed that some browsers via a build in development feature allow you to choose different user agents.
Does this mean that they change their rendering engine?
Say for example, if I set Safari's user agent to internet explorer - will that then change the rending engine from webkit to trident?
At the moment on my mac I have Safari, Chrome, Firefox and iCab installed. I would imagine they would represent the different engine's better than the user agent function built in.
However you are only limited to installing 1 version of each unless you go the virtual machine or dual boot way.
So what is your advice? Run multiple virtual machine and of course the extra licenses to do it legal will need to be purchased. or stick with the user agent function built in and that gives a good enough interperatation of the differences??
Cheers Jeff
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不。用户代理只是浏览器发送的用于标识自身的字符串。如果我愿意,我可以将我的用户代理设置为芝士汉堡。它不会使用芝士汉堡来尝试渲染页面。
官方规定,运行 Internet Explorer 的唯一正确方法是在 Windows 上 - 这需要安装 Windows - 虚拟机是一个完美有效且常见的解决方案。在 Mac 上,您还可以选择 Bootcamp。
还有其他服务,例如 http://browsershots.org/,允许您指定 URL,然后他们会向您发送内容的屏幕截图URL 就像在特定浏览器中一样。我通常不喜欢这些解决方案,因为它们很慢,你没有任何调试工具等。
No. A user agent is just a string that the browser sends to identify itself. I could set my user agent to cheeseburger if I wanted. It won't use a cheeseburger to try and render the page.
Officially, the only correct way to run Internet Explorer is on Windows - which would require a Windows installation - a VM is a perfect valid and common solution. On a Mac you also have the option of Bootcamp.
There are other services, like http://browsershots.org/, that allow you to specify a URL and they will send you a screenshot of what the URL likes like in a particular browser. I typically don't like these solutions because they are slow, you don't have any debugging tools, etc.
Safari(和其他浏览器)中的用户代理设置仅欺骗用户代理,它不会更改渲染引擎。例如,您可以使用这种欺骗手段,在桌面浏览器中获取 iPhone 版本的网页。要在不同的浏览器中检查您的页面,您可以使用一些网络服务,例如 http://browsershots.org/ (这只是第一个谷歌结果)或设置虚拟机阵列。我们做后者,这需要花费你2-3个windows许可证,但是你可以将很多浏览器打包到一个虚拟机中,只需在不同的机器之间分发不同的版本即可
the user agent setting in safari (and other browsers) only spoofs the user agent, it doesn't change the rendering engine. you can use that spoofing, to get for example the iPhone version of a webpage in your desktop safari. to check your page in different browsers, you could use some web service like http://browsershots.org/ (thats just the first google result) or setup an array of virtual machines. we do the latter, which ineed costs you 2-3 windows licenses, but you can pack a lot of browsers into one virtual machine, just distribute the different versions among different machines