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.
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" >w3wiki</ 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
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.