microsoft / vscode-edge-debug2

This is a VS Code extension which helps you debug your JavaScript Code inside the Edge browser.
Other
37 stars 31 forks source link

Add support for launching an application using WebView2 #158

Closed jalissia closed 4 years ago

jalissia commented 4 years ago

This PR adds support for using the debugger against an application using an embedded WebView2.

The code adds a new optional property to the launch.json called useWebView which when set to true causes the launch procedure to take additional steps. When the using a WebView, the launch function will set the appropriate environment variables for the runtimeExecutable so that debugging is enabled and script execution pauses on startup. The attach and runConnection functions are then altered so that script execution on the WebView is resumed once any startup breakpoints have been bound.

dhanvikapila commented 4 years ago

@jalissia Since these are changes in the chrome parts, it would make sense to make these changes in the chrome-debug/chrome-core as we periodically merge changes from those into this package. If we fork this off, then the merges get messy unfortunately.

rakatyal commented 4 years ago

@dhanvikapila : I agree with your point, but since WebView2 is only for the Anaheim runtime (with no plans in the future to be integrated in Chrome) , maybe we should keep it here?

dhanvikapila commented 4 years ago

The new Edge is Chromium backed though. It's not Spartan WebView.

Even If you do put this code here, what happens when we want to merge changes from chrome debug adapter into this package to pick up new fixes from Chrome? The merge gets more painful and difficult the more things like these that we add. We need to fig. out a better way to merge code between new Edge Chromium and Chrome itself but that is outside the scope of this PR.

rakatyal commented 4 years ago

@jalissia: As discussed offline, let's create a new class (webViewAdapter.ts or something) which extends src/chromeDebugAdapter.ts and port these changes there. That way we can easily merge changes from the chrome debug adapter to this repo.

On the VS side, I will check for the WebView support flag and launch this new executable instead.