Change the browser User Agent

Change browser User Agent tool
Change browser User Agent tool

Purpose of "Change user agent" tool

This tool will allow a user to change user agent for websites.

This tool has many applications for example:

  • A user can use this tool to test how a website might appear on a different device
  • A user can also use this tool to access certain features of a website that are available only for specific devices.

Requirements to use this tool

To use this tool, a user should have "Toolkit For Web Developer" chrome extension installed on their web browser.

To download and install "Toolkit For Web Developer", please visit our download page: Download Toolkit For Web Developer

Supported document types

Document type Supported
main document yes
iframe elements yes
shadow dom yes

Nested shadow elements and nested iframe elements are not fully supported by this tool.

This tool also does not support shadow root opened with the closed mode.

Information about pattern matching

A pattern is essentially a URL that begins with a permitted scheme (http, https, or file, and that can contain * characters. The special pattern <all_urls> matches any URL that starts with a permitted scheme.

File access: Access to file URLs is not automatically granted. The user must visit the extension management page and opt in to file access.

Each match pattern has 3 parts:

  • scheme — for example, http or *

  • host : for example, www.example.com or *.google.com or *; if the scheme is file, there is no host part

  • path : for example, /*, /foo*, or /foo/bar. The path must be present in a host permission, but is always treated as /*.

Here's the basic syntax:

<url-pattern> := <scheme>://<host><path>
<scheme> := '*' | 'http' | 'https' | 'file' | 'ftp'
<host> := '*' | '*.' <any char except '/' and '*'>+
<path> := '/' <any chars>

The meaning of * depends on whether it's in the scheme, host, or path part. If the scheme is *, then it matches either http or https, and not file, or ftp. If the host is just *, then it matches any host. If the host is *.hostname, then it matches the specified host or any of its subdomains. In the path section, each * matches 0 or more characters.

Examples of valid pattern


Pattern: <all_urls>

Description: Matches any URL that uses a permitted scheme.

Matching URLs: http://example.com/foo/bar.html, file:///bar/baz.html


Pattern: *://abc.example.com/*

Description: Matches any URL that starts with http://abc.example.com or https://abc.example.com.

Matching URLs: http://abc.example.com/foo/baz/bar, https://abc.example.com/foobar


Pattern: http://127.0.0.1/*

Description: Matches any URL that uses the http scheme and is on the host 127.0.0.1.

Matching URLs: http://127.0.0.1/, http://127.0.0.1/foo/bar.html


Pattern: file:///foo*

Description: Matches any local file whose path starts with /foo.

Matching URLs: file:///foo/bar.html, file:///foo


Pattern: http://example.com/foo/bar.html

Description: Matches the specified URL

Matching URLs: http://example.com/foo/bar.html


Pattern: https://*.example.com/foo*bar

Description: Matches any URL that uses the https scheme, is on a example.com host (such as www.example.com, docs.example.com, or example.com), as long as the path starts with /foo and ends with bar.

Matching URLs: https://www.example.com/foo/baz/bar, https://docs.example.com/foobar


Pattern: http://*/foo*

Description: Matches any URL that uses the http scheme, on any host, as long as the path starts with /foo.

Matching URLs: http://example.com/foo/bar.html http://www.example.com/foo


Pattern: http://*/*

Description: Matches any URL that uses the http scheme.

Matching URLs: http://www.example.com/, http://example.com/foo/bar.html

Information about bad patterns

Pattern: http://www.google.com

Why it is bad: No path


Pattern: http://*foo/bar

Why it is bad: * in the host can be followed only by a . or /.


Pattern: http://foo.*.bar/baz

Why it is bad: If * is in the host, it must be the first character.


Pattern: http:/bar

Why it is bad: Missing scheme separator (/ should be //)


Pattern: foo://*

Why it is bad: Invalid scheme.


How to use "Change user agent" tool

Follow these steps to use this tool:

  • Click on "Toolkit For Web Developer" extension icon, after that a popup page will be opened.
  • Click on "Open background tools" button, this will open background tools in a new tab page.
  • Select "Change user agent" from left drawer menu.
  • After that, "Change user agent" tool will be displayed on right side of the window.
  • Click on "ADD NEW USER AGENT RULE" button.
  • Enter a custom URL pattern.
  • Select a custom user agent from the dropdown list.
  • Click on "Add" button.
  • Click on "Apply changes and reload" button to apply changes.

How to edit a user agent rule

Follow these steps to edit user agent rule :

  • Click on "Toolkit For Web Developer" extension icon, after that a popup page will be opened.
  • Click on "Open background tools" button, this will open background tools in a new tab page.
  • Select "Change user agent" from left drawer menu.
  • After that, "Change user agent" tool will be displayed on right side of the window.
  • Click on "Edit" button of user agent rule.
  • Enter a new pattern to replace old pattern.
  • Select a new custom user agent.
  • Click on "Save" button.
  • Click on "Apply changes and reload" button to apply changes.

How to delete a user agent rule

Follow these steps to delete user agent rule :

  • Click on "Toolkit For Web Developer" extension icon, after that a popup page will be opened.
  • Click on "Open background tools" button, this will open background tools in a new tab page.
  • Select "Change user agent" from left drawer menu.
  • After that, "Change user agent" tool will be displayed on right side of the window.
  • Click on "Delete" button of user agent rule.
  • Click on "Apply changes and reload" button to apply changes.

How to enable an existing pattern

Follow these steps to enable a pattern:

  • Click on "Toolkit For Web Developer" extension icon, after that a popup page will be opened.
  • Click on "Open background tools" button, this will open background tools in a new tab page.
  • Select "Change user agent" from left drawer menu.
  • After that, "Change user agent" tool will be displayed on right side of the window.
  • User will see list of saved user agent rules.
  • Use "Enabled" / "Disabled" button to enable a specific user agent rule.
  • Click on "Apply changes and reload" button to apply changes.

How to disable an existing pattern

Follow these steps to disable a pattern:

  • Click on "Toolkit For Web Developer" extension icon, after that a popup page will be opened.
  • Click on "Open background tools" button, this will open background tools in a new tab page.
  • Select "Change user agent" from left drawer menu.
  • After that, "Change user agent" tool will be displayed on right side of the window.
  • User will see a list of saved user agent rules.
  • Use "Enabled" / "Disabled" button to disable a specific user agent rule.
  • Click on "Apply changes and reload" button to apply changes.
Other Posts