How to Completely Disable ‘View Source’ (Ctrl+U) via Group Policy in Microsoft Edge

Microsoft Edge includes robust developer tools, allowing users to inspect web page structures and view the raw HTML payload by simply pressing Ctrl+U (View Source) or right-clicking and selecting “View page source”. While essential for web developers, granting access to the raw source code introduces a security vulnerability and intellectual property risk on highly secured corporate kiosks, standardized data-entry terminals, or strict enterprise environments. Allowing unauthorized users to view the source code can expose hidden API endpoints, hardcoded developer comments, or underlying architectural logic that should remain strictly obfuscated from standard end-users.

This guide explains how to completely disable the ‘View Source’ functionality via Group Policy in Microsoft Edge, enforcing a strict block that prevents users from exposing the underlying HTML payload of any rendered web page.

Disable View Source via Group Policy

Because “View Source” is a fundamental component of the browser’s developer toolset, we must explicitly deploy an administrative template that suppresses the rendering engine’s ability to expose source code, disabling both the keyboard shortcut and the context menu entry.

  1. Log into Windows with an Administrator account.
  2. Press the Windows Key + R to open the Run dialogue box.
  3. Type gpedit.msc and press Enter to launch the Local Group Policy Editor.
  4. In the left-hand navigation pane, strictly follow this exact path:
    Computer Configuration > Administrative Templates > Microsoft Edge
  5. In the right-hand pane, locate the policy named Control where developer tools can be used (internally known as DeveloperToolsAvailability).
  6. Double-click the policy to open its configuration window.
  7. Select the radio button next to Enabled.
  8. Under the “Options” section, change the “Control where developer tools can be used” dropdown to 2 – Don’t allow using the developer tools. (By explicitly setting this flag to 2, we instruct the Edge rendering engine to completely disable the Developer Tools suite, which immutably hard-blocks the View Source function).
  9. Click Apply, then click OK.

Verify the Configuration Lockdown

Group Policy changes modifying Edge core developer features require the browser to update its local policy state.

Close all active instances of Microsoft Edge. To force the policy update immediately across the OS, open Command Prompt as Administrator and run gpupdate /force. To verify the restriction is actively enforced, launch Microsoft Edge and navigate to any web page. Right-click anywhere on the page; you will immediately notice that the “View page source” and “Inspect” options are completely absent from the context menu. Furthermore, pressing Ctrl+U or F12 will yield absolutely no response from the browser. The terminal is now strictly optimized, ensuring that the underlying HTML payload remains completely obfuscated from the end-user.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.