用户代理字符串是一条鲜为人知的信息行,对浏览器如何看待网络有很大影响。我们最近讨论了用户代理切换器的好处(benefits of a user-agent switcher)以及它如何增强您的浏览体验。
但是,切换浏览器的用户代理不再需要您安装第三方软件,例如扩展程序。在过去的几年里,主流浏览器都开始将这些功能包括在他们的开发者控制台或标准菜单中。
虽然不常见,但浏览器扩展有可能被恶意劫持,这可能会给您的安全带来风险。他们还可以给浏览器增加不必要的膨胀,最终导致它变慢。
在本文中,让我们讨论如何在当今最流行的浏览器中更改用户代理,而无需扩展。
如何在 Google Chrome 中更改您的用户代理(How To Change Your User Agent In Google Chrome)
- 首先,您需要打开 Chrome 的开发者控制台。为此,请按Ctrl + Shift + I键。Chrome窗口的右侧应该会打开一个面板。
- 单击三个垂直点的图标(icon of the three vertical dots)
(右上角)。
- 在此菜单中,将鼠标悬停在更多工具(More tools)上,然后选择网络条件(Network conditions)。
- 一个新面板应在当前面板的底部打开。如果您查看或向下滚动到此面板的底部,您应该会看到一个用户代理(User agent)
标签,其中包括一组相应的选项。
在这里,您可以从一组定义的用户代理中进行选择,甚至可以输入您自己的自定义用户代理字符串(custom user agent string)。就是这么简单。
如何在 Mozilla Firefox 或 Opera 中更改用户代理(How To Change Your User Agent In Mozilla Firefox Or
Opera)
在不使用浏览器插件的情况下,更改 Firefox 的用户代理是一项棘手的任务,需要您深入研究浏览器的配置。对于Opera用户,您可以按照这些相同的说明进行操作——过程是相同的。
- 第一步是在地址栏中
输入about:config并按(about:config)Enter。如果这是您第一次这样做,您应该会看到一个免责声明,说明您正在进入仅适用于高级用户的风险领域。继续跳过此警告。
- 接下来,在此屏幕顶部的Search字段中,输入(Search)general.useragent.override。您可能会遇到一个空白屏幕。但是,如果您的搜索找到了偏好,请在此页面进一步向下跳到我们正在修改它的值的位置。
- 如果首选项不存在,请右键单击页面的空白区域,将鼠标悬停在 New(New)上,然后选择String选项。在这里,输入我们搜索的相同字符串:general.useragent.override。
- 输入用户代理字符串后,点击Enter,就是这样。每次重新启动浏览器时,此设置都将保持不变。如果您想将此设置重置为其默认值,只需右键单击首选项名称并选择重置(Reset)。
该字符串将保留在您的设置中,但将其设置为空白值与删除它具有相同的效果。
如何在 Microsoft Edge 中更改您的用户代理(How To Change Your User Agent In Microsoft Edge)
Edge 是微软(Microsoft)最近试图引起关注的新浏览器,但如果你仍然喜欢Internet Explorer,更改用户代理的过程是相同的。
- 首先,打开 Edge 并按键盘上的F12键。
- 在打开的右侧面板中,在顶部查找仿真。(Emulation)根据您的分辨率大小,您一开始可能无法找到它,但如果您使用更多工具工具提示单击(More
tools)指向下方的箭头(arrow
pointing downwards),您会找到它。
Edge 的仿真选项非常强大,允许您更改设备、显示方向/分辨率、地理位置和用户代理字符串。
像许多其他浏览器一样,Edge支持自定义用户代理字符串(custom user-agent strings)。
如何在 Safari 中更改用户代理(How To Change Your User Agent In Safari)
Safari
允许您从菜单栏中更改用户代理,但您首先需要启用开发人员菜单。
- 为此,请进入Preferences...菜单(通过单击Safari或最右侧的齿轮图标(cog icon),具体取决于您的版本)。
- 在弹出的窗口中,单击Advanced选项卡,然后勾选最底部选项的复选框Show Develop menu in menu bar。
- 关闭此窗口并在顶部菜单栏中查找“开发(Develop)”菜单,您可以在同一位置看到“文件”、“编辑”、“视图(File,
Edit, View)”和其他菜单选项。
- 如果您没有看到这行选项,您可能需要再次单击Safari菜单选项或cog 图标(cog
icon),然后单击Show Menu Bar。
- 接下来,单击“开发(Develop)”菜单选项,将鼠标悬停在“用户代理(User Agent)”上,您将看到可以切换到的用户代理列表。
- 虽然预设列表不是很广泛,但单击Other...将为您提供输入您自己的自定义用户代理字符串(custom user-agent string)的选项。
如果您不害怕深入了解,通过浏览器的首选项或开发人员控制台更改用户代理字符串是跳过一个额外的浏览器扩展的好方法。那里有数百万个有效的用户代理字符串,所以请记住,在预设不提供您正在寻找的内容的情况下,使用自定义字符串通常是一种选择。
此外,如果您想按预期浏览互联网,请记住清除或撤消对用户代理字符串所做的所有更改。许多网站会根据您的用户代理改变向您提供内容的方式,因此忘记这一点可能会导致您以次优方式查看网站。
How To Change Your Browser’s User Agent Without Installing An Extension
The user-agent string is a little-known line of information with a very big іmpact оn hоw browsers see the web. We recentlу discussed the benefits of a user-agent switcher and how it can enhance your browsing experience.
However,
switching your browser’s user agent no longer requires that you install
third-party software, such as extensions. Over the past few years, mainstream
browsers have all started including such functionality as a part of their
developer console or within standard menus.
Although
uncommon, there is a chance for browser extensions to become hijacked for
malicious purposes, which could be a risk to your security. They can also add
unnecessary bloat to the browser and eventually cause it to slow down.
In
this article, let’s go over how you can change your user agent in today’s most
popular browsers without an extension.
How To Change Your User Agent In Google Chrome
- First, you’ll need to open
Chrome’s developer console. To do so, press the Ctrl + Shift + I keys. A panel should open up on the right side of
your Chrome window.
- Click on the icon of the three vertical dots
(top-right corner).
- In this menu, hover over More tools and then select Network conditions.
- A new panel should open at
the bottom of the current one. If you look or scroll down towards the bottom of
this panel, you should see a User agent
label, which includes a respective set of options.
Here, you can select from a set of defined user agents or even enter your own custom user agent string. It’s that simple.
How To Change Your User Agent In Mozilla Firefox Or
Opera
Without
using a browser add-on, changing Firefox’s user agent is a tricky task that
requires you to delve deep into the browser’s configuration. For Opera users,
you can follow these same instructions – the process is identical.
- The first step is to type about:config in the address bar and hit
Enter. If it’s your first time doing
so, you should see a disclaimer stating that you’re entering risky territory
that’s for advanced users only. Proceed past this warning.
- Next, in the Search field at the top of this screen,
type in general.useragent.override.
You’ll likely be met with a blank screen. If your search finds a preference
though, skip further down this page to where we’re modifying the value of it.
- If the preference isn’t there, right-click on a blank area of the page, hover New, and select the String option. Here, enter the same string that we searched for: general.useragent.override.
- After hitting Enter, the next prompt will ask for the new string’s value. The value has to be the exact name of the user-agent string you wish to use. You can use something completely custom or find millions of valid user-agent strings from WhatIsMyBrowser.com.
- Once you’ve input a
user-agent string, hit Enter, and
that’s it. This setting will remain persistent each time you restart your
browser. If you’d ever like to reset this setting to its default value, just
right-click on the preference name and select Reset.
The
string will remain in your settings, but setting it to a blank value has the
same effect as deleting it.
How To Change Your User Agent In Microsoft Edge
Edge
is the new browser that Microsoft has been trying to shine a spotlight on
lately, but if you still prefer Internet Explorer, the process to change your
user agent is the same.
- First, open Edge and press
the F12 key on your keyboard.
- In the right-side panel that
opens, look for Emulation across the
top. Depending on your resolution size, you may not be able to find it at
first, but if you click on the arrow
pointing downwards with the More
tools tooltip, you’ll find it.
Edge’s
emulation options are quite robust, allowing you to change your device, display
orientation/resolution, geolocation, and user-agent string.
Like many other browsers, Edge supports custom user-agent strings.
How To Change Your User Agent In Safari
Safari
allows you to change your user agent from the menu bar, but you’ll first need
to enable the developer menu.
- To do so, go into the Preferences… menu (either by clicking
on Safari or the far-right cog icon, depending on your version).
- On the window that pops up,
click on the Advanced tab and then
tick the checkbox of the bottommost option, Show Develop menu in menu bar.
- Close this window and look
for the Develop menu across your top
menu bar, in the same place you see the File,
Edit, View, and other menu options.
- If you don’t see this row of
options, you may need to click again on either the Safari menu option or cog
icon and click on Show Menu Bar.
- Next, click on the Develop menu option, hover User Agent, and you’ll see a list of
user agents you can switch to.
- While the preset list isn’t very extensive, clicking on Other… will give you the option to enter your own custom user-agent string.
If
you’re not afraid to go under the hood, changing the user-agent string via the
preferences or developer console of your browser is a great way to skip out on
one extra browser extension. There are millions of valid user-agent strings out
there, so keep in mind that using a custom string is usually an option in the
case that the presets don’t offer what you’re looking for.
Also,
remember to clear or undo all changes made to your user-agent string if you
want to browse the internet as intended. Many websites will alter the way
content is delivered to you based on your user agent, so forgetting this can
cause you to view websites in a suboptimal way.