Block http requests sent to a specific URL pattern

Block http requests tool
Block http requests tool

Purpose of "Block http requests of sites" tool

This tool will allow a user to block http requests whose target URL matches with a specific URL pattern.

This tool has many applications for example: This tool can be used to simulate situations where a specific host responsible for handling HTTP requests on a website is down or blocked by the firewall and to test how a website may respond to it.

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 "Block http requests of sites" 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 "Block http requests of sites" from left drawer menu.
  • After that, "Block http requests" tool will be displayed on right side of the window.
  • Enter custom URL pattern and click on "Add Pattern" button.
  • Click on "Apply changes and reload" button to apply changes.

How to edit an existing pattern

Follow these steps to edit 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 "Block http requests of sites" from left drawer menu.
  • After that, "Block http requests" tool will be displayed on right side of the window.
  • Click on "Edit" button of pattern.
  • Add new pattern and click on "Save" button.
  • Click on "Apply changes and reload" button to apply changes.

How to delete an existing pattern

Follow these steps to delete 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 "Block http requests of sites" from left drawer menu.
  • After that, "Block http requests" tool will be displayed on right side of the window.
  • Click on "Delete" button of pattern.
  • 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 "Block http requests of sites" from left drawer menu.
  • After that, "Block http requests" tool will be displayed on right side of the window.
  • User will see a list of saved patterns.
  • Use the toggle button that shows "Disabled" to enable a specific pattern. If the background of the stored pattern turns from red to normal it means that pattern is enabled.
  • 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 "Block http requests of sites" from left drawer menu.
  • After that, "Block http requests" tool will be displayed on right side of the window.
  • User will see a list of saved patterns.
  • Use the toggle button that shows "Enabled" to disable a specific pattern. If the background of a pattern becomes red it means that pattern is disabled.
  • Click on "Apply changes and reload" button to apply changes.
Other Posts