Use the Network request blocking panel to test how your page behaves if certain resources, such as images or stylesheets, are prevented from loading.
The Network request blocking panel lets you block multiple resources or "patterns" at the same time and toggle them from a list. You can also block network request domains or URLs from the Network panel and the respective patterns will appear in the Network request blocking panel.
The Network request blocking panel lets you:
Closing DevTools disables network request blocking. You have to open the panel and enable blocking again. However, DevTools saves the patterns even after the browser is closed.
To open the Network request blocking panel:
Network request blocking
, select Show Network request blocking, and press Enter. DevTools displays the Network request blocking panel at the bottom of your DevTools window.Alternatively, in the top right corner, select
More options > More tools > Network request blocking.There are two ways to block a network request. First:
In the Network request blocking panel, click
Add pattern. An input box appears prompting you to enter a "Text pattern to block matching requests."You can enter any of the following:
*
" for wildcard pattern matching.Click Add and make sure the Enable network request blocking checkbox is checked.
Reload the page. The Network request blocking panel shows the number of requests blocked next to the pattern.
Secondly, you can block network requests from the Network panel in DevTools.
The number of blocked requests may update as more requests are made. Refreshing the page resets the numbers.
To remove a specific network request blocking pattern from the list:
To remove all network request blocking patterns, in the activity bar, click the
Remove all network blocking patterns button.To modify a pattern, in the Network request blocking panel, click the
Edit button next to the pattern, edit it, and click Save.The
Enable network request blocking checkbox lets you enable and disable network request blocking for all patterns at once.Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-03-21 UTC.