Skip to content

How to: Auto open DevTools

David Risney edited this page Jan 6, 2023 · 4 revisions

Many apps will block the end user from opening DevTools. As a developer you can use WebView2Utilities to auto open DevTools when a WebView2 is created.

  1. Install and run WebView2Utilities
  2. Select the Overrides tab.
  3. Press the Add New button.
  4. Select the newly added entry in the list.
  5. Change the Host app exe textbox to be the name of the executable file of your host app. For example, OUTLOOK.EXE.
  6. Check the Auto open DevTools checkbox.
  7. If already running, close your host app.
  8. Restart your host app.

When the host app creates a WebView2 it should now automatically open DevTools.

image

You can manually do the same thing without using WebView2Utilities by setting an appropriate registry key [{Root}]\Software\Policies\Microsoft\Edge\WebView2\AdditionalBrowserArguments (as described in the WebView2 docs) to include the --auto-open-devtools-for-tabs command line argument.