Open In App

Network Request Blocking in Microsoft Edge Browser

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:

Benefits:

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.



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.

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.

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




<!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.open("GET", "https://jsonplaceholder.typicode.com/posts/1", true);
 
 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

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.

Step 2: Goto to Network Tab

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

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

Step 2: Goto Network Tab

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

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

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.


Article Tags :