Giter Club home page Giter Club logo

webview2utilities's Introduction

WebView2Utilities

WebView2Utilities help you develop and debug Microsoft Edge WebView2 apps.

Screenshot of WebView2 Utilities

Install & Run

UI details

The app has three tabs for the different main WebView2Utilities features. Each tab has a Refresh button in the tab which you can use to force the information in that to reload.

Host Apps tab

This tab lists the running processes that are using WebView2. By default Discover more Host Apps information (slower) is unchecked and the processes listed will be those with a WebView2 mojo connection. Their HWND trees are examined to try to find their corresponding WebView2 runtime browser process. This may not work in some cases and you can try checking the Discover more checkbox. This will examine all processes, not just those with a WebView2 mojo connection, walk all HWND trees, and examine process parents. This finds more information but is slower.

When selecting a Host App from the list on the left you can see details about the Host App on the right:

  • IL will report if the Host App process is running as admin, or in an app container.
  • SDK version is the version of the SDK DLLs that the Host App process has loaded.
  • Probable UI framework is WinForms, WPF, WinUI2, or WinUI3 and based on what DLLs the Host App process has loaded.
  • Similarly Probable API kind reports Win32, WinRT, or .NET also based on the DLLs loaded by the Host App process.
  • Both are 'probable' because its likely based on what DLLs the Host App process has loaded but not definitive.
  • The Runtime path, version, and channel are based on the WebView2 runtime DLL loaded by the Host App process. If these are Unknown then the host app is using WebView2 SDK DLLs but has not created a WebView2 yet.
  • The User data folder and Browser process PID are based on the browser process used by the host app process. As mentioned above, WebView2Utilities may not always be able to discover the browser process used. In that case the Runtime path will have a valid value, but the User data folder and Browser process PID will be listed as Unknown. You can try checking the Discover more checkbox in that case.

There are some buttons below the detail information:

  • Open Override will create an entry for the selected app, if one doesn't already exit, in the Override tab, switch to the Override tab, and select the corresponding override entry.
  • Create Report will create a zip file containing information displayed in WebView2Utilities as well as any crash dumps or chromium logs for the selected host app. Note that personal information may be stored in the zip file as a part of the crash dump or elsewhere in the file. Only share the zip with people you trust.

The Watch for changes checkbox is checked by default. When checked WebView2Utilities will check for changes to the set of processes with a WebView2 mojo connection every three seconds and if there is a change, the tab will be refreshed automatically. Otherwise, you can use the Refresh button in the tab title to refresh the list manually.

Runtimes tab

The Runtimes tab lists the found installed WebView2 Runtimes and non-stable Microsoft Edge browser installations. These are paths that you might use with the Fixed Version field in the Overrides tab.

There's a section at the bottom with links to install additional versions of the WebView2 Runtime.

Override tab

This tab helps you set the loader override policy registry keys.

  • Host app exe is the name of the host app's executable that the rest of the settings will apply to. It applies to future webview2 creations. The '* (All other apps)' entry applies to all apps that don't have a specific entry in this list.
  • Runtime contains three options for forcing apps to pick a WebView2 Runtime.
    • Evergreen is the usual manner of finding the WebView2 Runtime as described in the WebView2 documentation. First the WebView2 Runtime, then Beta, then Dev, then Canary channels.
    • Evergreen with preview build reverses the usual order of discovering installed WebView2 Runtimes looking for the least stable channel first.
    • Fixed Version lets you select an explicit path for a WebView2 Runtime. The path should have the msedgewebview2.exe in it. If set, the host app will use this runtime instead of whatever they requested.
  • Browser arguments is additional command line switches to be passed to the browser process created for the WebView2. If set, this is merged in with whatever the app sets. See the list of chromium command line switches to see what switches exist.
    • Common browser argument checkboxes follow. Checking these will alter the Browser Arguments text box to include or exclude these common browser arguments.
    • Auto open DevTools when set will cause the WebView2 to automatically open DevTools when the WebView2 is first created.
    • Logging when set will enable chromium logging to a log file in the user data folder. This log will be captured by the Create Report button on the Host Apps tab.
  • User data path is the path to a user data folder. If set the host app will use this user data folder instead of whatever they requested.
  • Launch RegEdit will open regedit.exe to the registry path of the override keys.

You can use the Add New and Remove buttons to add and remove entries to the list. Additionally the Host app exe has a drop down of running host app executables for your convenience. Similarly, the Fixed Version has a drop down of found WebView Runtimes.

About tab

Application version and helpful links.

webview2utilities's People

Contributors

champnic avatar david-risney avatar master-ukulele avatar oggy22 avatar peiche-jessica avatar vickiez avatar victorhuangwq avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

webview2utilities's Issues

Add links to crash dump locations

This may not be as useful when the "Create Report" button is fully fleshed out, but may still be useful if the dev wants to check themselves what crashes have occurred, or want to open or share a specific dump.

Override entry removed when reloading Host Apps tab

  1. Start WebView2APISamples.exe
  2. Refresh 'Host Apps' tab and validate WebView2APISamples.exe shows up there.
  3. In Overrides tab, press 'Add New' button.
  4. Change Host app exe to WebView2APISamples.exe
  5. Select 'Fixed Version' and choose a runtime
  6. Validate in the registry that the correct info is there
  7. Keyboard up and down in the Overrides entry list to validate the entry continues to exist
  8. Press the 'Refresh' button on the 'Host Apps' tab
  9. Go back to the new Override entry and notice the 'Host app exe' text is now blank and the entry is gone from the registry.

Open Shared Workers

The URI edge://inspect#workers lets you inspect shared workers. You can nav to that in a new webview2 connected to the same env / browser process to see shared workers for that session. Add a button to that for running webview2 processes.

Update Overrides tab UI by scenario

Instead of

Runtime path: ...
[ ] Reverse runtime search order

How about radio buttons to choose between scenario:

[ ] Evergreen
[ ] Evergreen preview
[ ] Fixed version
Runtime path: ...

Include local build folders in WebView2 Runtime list

Would be nice to include WebView2 Runtime local repo build folders in the list of Runtimes. There's no set format for the path but seems to be commonly under a folder in the root of a drive like *:\*\src\out\release_*\msedgewebview2.exe

Break out Host Apps tab list view into simpler list on left with details view on right

Currently the list view in the Host Apps tab is hard to read. There's a bunch of columns that contain very long strings. Instead lets break the tab in half with a list of process name and PID on the left, and when something in that list is selected, a details list on the right gets populated with all the other columns there now as key/value entries in the list.

Add a semi-permanent `All other apps` entry to overrides

Make it easy to see that you can set overrides for all apps with a permanent entry in the list for 'All other apps' that uses '' in the host app exe. If its not actually in the registry we can still add the sort of empty entry for ''

Make folders into clickable links

For ease of using folder paths, they should be clickable links. Currently the dev has to copy them into Run or Explorer, which isn't so bad.

Tests project missing

I added tests but only committed some of the new files / changes for it. Need to push the rest when I get home.

Include SDK version in Host Apps tab

We're already looking for the client DLL from the runtime loaded in the host app processes. We could easily also look for SDK dlls loaded in the host app processes.

User Data Path truncation

Host Apps tab: User Data Path is truncated after first spacebar. For example, my user data path "c:\Users\Mike Duglas\AppData\Roaming\MikeDuglas" becomes "c:\Users\Mike".

Host app exe name changes don't appear in Override list

If in the Override tab, you press the 'Add New' button, and change the Host app exe to something else, the change is applied everywhere and everything works, but the name in the Override list on the left remains the same value.

Show browser PID or URL in host app list

Currently if there are multiple WebView2's associated with a host app, the host app appears multiple times in the list with no distinction between them. We should probably show at least the PID of the browser process. Ideally, we would show the URL in the connected WebView2 as that's easier to distinguish for a developer.

Cleanup new Host Apps UI

The new controls on the Host Apps tab (details group, view overrides button) needs to look nicer:

  • Should have reasonable amount of space between Details group and button below it
  • Also space between the buttons / details group and the list on the left
  • 'View Overrides' isn't quite right. Maybe 'Open Override' to better indicate that we might create an override. And use singular 'override' not 'overrides' to make it clearer this is for the selected app
  • When no app is selected disable the button and maybe disable all the textboxes

Highlight override entries with bad paths

Show a red error icon by override entries that have a runtime path or user data folder path that doesn't exist. This can happen when specifying a particular channel version path and then the version updates.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.