Open In App

Network Request Blocking in Microsoft Edge Browser

Last Updated : 30 Oct, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

One can manage network requests with Microsoft Edge using a feature called Block Network Request. Developers can control network activities. This is helpful for reasons like debugging, security, and page load optimization. In this article, we will understand how to block network activities with this option.

The blocking of requests is done in the Networks tab. This allows you to assess how incoming responses affect a website’s performance. The network tab is one of the tools present in the developer tools.

Features:

  • You can view network requests as they happen with Microsoft Edge’s Developer Tools, which offer real-time monitoring.
  • You have fine-grained control over what loads on a page by being able to block individual requests or entire domains.
  • You can evaluate the effect on page loading times and optimize a website for better performance by blocking requests that aren’t necessary.
  • By mimicking the effects of missing resources, blocking requests can help you locate possible security flaws.

Benefits:

  • This feature allows developers to solve problems about broken links, mixed content errors, and resource loading.
  • You can improve a website’s performance and cut down on needless resource loading by selectively blocking requests.
  • By mimicking the lack of essential resources, experts in security can evaluate website behavior.

Steps to Block Network Requests in Edge by Network Tool:

Step 1: Launch Microsoft Edge and open Developer Tools: To open the Developer Tools, press F12 or right-click on the page and choose Inspect. As an alternative, you can use the keyboard shortcut Ctrl+Shift+I/J.

ezgifcom-resize

Step 2: Locate and select the Network Tab: On the “Network” tab in the Developer Tools window, click. Every network activity pertaining to the webpage is shown on this tab.

ezgifcom-video-to-gif-(2)

Step 3: Refresh the page: It is best to reload the page in order to capture network requests right away. You can accomplish this by hitting F5 in Edge or clicking the refresh button on the website.

Step 4: Block Requests: All of the network requests are listed under the Network tab. Click on a request, then use the right-click menu to choose Block Request URL. By performing a right-click on the domain name, you can also block the entire domain.

ezgifcom-video-to-gif(37)

Example: Let us implement the above steps by blocking a request to jsonplaceholder API request.

HTML




<!DOCTYPE html>
 <html lang="en">
 <head>
     <meta charset="UTF-8">
     <meta name="viewport" content="width=device-width, initial-scale=1.0">
     <title>Adding Request Blocks</title>
 </head>
 <body>
     <h1 style="color:green">GeeksforGeeks</h1>
     <script>
        var xhr = new XMLHttpRequest();
 
 xhr.onreadystatechange = function () {
     if (xhr.readyState === 4 && xhr.status === 200) {
         console.log(xhr.responseText);
     }
 };
 
 xhr.send();
   </script>
 </body>
 </html>


Output : The request to https://jsonplaceholder.typicode.com/posts/1 unless the block is removed

ezgifcom-video-to-gif(37)

How to delete blocked network request?

In Microsoft Edge’s Developer Tools, you can easily manage network requests, including unblocking blocked requests. Here’s a simple guide on how to delete a blocked network request:

Step 1: Open Microscoft Edge and then Developer Tools.

ezgifcom-video-to-gif(29)

Step 2: Goto to Network Tab

ezgifcom-video-to-gif-(2)

Step 3: Find and right-click on the blocked request URL and select Unblock URL

ezgifcom-video-to-gif(39)

How to Modify Blocked Network Request in Edge?

In certain scenarios, you may need to modify a blocked network request to suit your development or testing needs. Here’s a simple guide on how to do that:

Step 1: Open Microscoft Edge and then Developer Tools

ezgifcom-resize

Step 2: Goto Network Tab

ezgifcom-video-to-gif-(2)

Step 3: Right click on blocked URL and select Edit and Resend . In the opened dialog box change the URL and click send.

ezgifcom-crop(2)

How to toggle the Blocked Network Request in Edge?

You can Toggle network request blocking without deleting and re-creating all blocked network requests:

Step 1: Block the request first by following the above steps and just uncheck/check the checkbox on the network request blocking tab

ezgifcom-crop(3)

Note : We are using the Example 1 to demonstrate all the above scenarios

Here we understood the Microsoft Edge’s network request blocking feature which added value to the privacy of the browser. You understood how efficient it is in managing network requests in Edge by following the instructions provided in this article.



Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads