Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: WebView2 debugging support #264

Merged
merged 3 commits into from
Jan 28, 2020
Merged

feat: WebView2 debugging support #264

merged 3 commits into from
Jan 28, 2020

Conversation

johnemau
Copy link
Contributor

@johnemau johnemau commented Jan 27, 2020

  • Minimum changed needed to support msedge debugger type, it is just an alias for chrome.
  • This change is equivalent to the launch.json {type: 'chrome', runTimeExecutable: 'path/to/msedge.exe'}.
  • Minimum change needed to support backwards compatibility with WebView2 launch
    debugging configurations (useWebView) from vscode-edge-debug2.

Follow-ups to consider:

  • Separate chrome and msedge debugger type configurations with Edge strings.
  • Validate useWebView configuration is configured with runTimeExecutable.
  • Tests for useWebView configuration.
  • Add browser version support (stable, beta, dev, canary) for Microsoft Edge (Chromium)
    to match backwards compatibility with vscode-edge-debug2.
  • Deprecate {useWebView: 'advanced'} in favor of {useWebView: true, urlFilter: 'bing.com'}
  • Deprecate useWebView in favor of webview debugger type.

Related: #235

@connor4312
Copy link
Member

Separate chrome and edge debugger type configurations with Edge strings.

👍 -- we already have an Edge-only configuration option, there'll surely be more eventually. We'll probably want to split BrowserLauncher into a BrowserLauncherBase and then a ChromeLauncher and EdgeLauncher, like we do for the Node launcher already. Firefox is becoming CDP-compatible as well so there may eventually be one of those as well. Would be happy to have that in this PR, but it could be a followup item for anyone to implement.

Validate useWebView configuration is configured with runTimeExecutable.

Would be nice to allow simply entering edge as a launch runtime executable. I assume Edge has well-known location(s). findBrowser.ts has a bunch of platform logic for this; you could add a new Executable in win32() that discovers an edge type, and then it'll work.

Add browser version support (stable, beta, dev, canary) for Microsoft Edge (Chromium)
to match backwards compatibility with vscode-edge-debug2.

Currently for Chrome we overload runtimeExecutable and allow users to enter stable, canary, etc. With multiple browsers this gets awkward. Maybe we introduce a separate browserVersion property for this.

John Emau added 2 commits January 27, 2020 13:22
* Minimum changed needed to support `edge` debugger type, it is just an alias for `chrome`.
* This change is equivalent to the launch.json `{type: 'chrome', runTimeExecutable: 'path/to/msedge.exe'}`.
* Minimum change needed to support backwards compatibility with WebView2 launch
  debugging configurations (`useWebView`) from [vscode-edge-debug2][1].
* Adds `urlFilter` support for `chrome` `launch` requests.

Follow-ups to consider:
* Separate `chrome` and `edge` debugger type configurations with Edge strings.
* Validate `useWebView` configuration is configured with `runTimeExecutable`.
* Tests for `useWebView` configuration.
* Add browser `version` support (`stable`, `beta`, `dev`, `canary`) for Microsoft Edge (Chromium)
  to match backwards compatibility with [vscode-edge-debug2][1].
* Deprecate `{useWebView: 'advanced'}` in favor of `{useWebView: true, urlFilter: 'bing.com'}`
* Deprecate `useWebView` in favor of `webview` debugger type.

[1]: https://github.com/microsoft/vscode-edge-debug
…caught in tests where launching with a URL other than about:blank was broken because setting the launch URL happens after the target is attached, but it would never attach if the filter failed.
@johnemau
Copy link
Contributor Author

johnemau commented Jan 27, 2020

I ran the Chrome integration tests locally (npm run intTests) and here are my results:

  13 passing (5m)
  46 pending
  32 failing

The failures do not match what was reported in issues #44, however I am not* worried because the report is likely out of date and I assume to need undocumented local changes to prune out false-negatives.

@johnemau
Copy link
Contributor Author

Would be happy to have that in this PR, but it could be a followup item for anyone to implement.

Lets do this in a follow-up PR for anyone to implement.

I assume Edge has well-known location(s). findBrowser.ts has a bunch of platform logic for this; you could add a new Executable in win32() that discovers an edge type, and then it'll work.

I agree and propose we update findBrowser.ts in a follow-up PR.

Currently for Chrome we overload runtimeExecutable and allow users to enter stable, canary, etc. With multiple browsers this gets awkward. Maybe we introduce a separate browserVersion property for this.

Sounds good to me, another good follow-up PR.


@connor4312, what is your preferred way to track the follow-up work?
Suggestions: I can file separate github issues or we can start a checklist on issue #235

@connor4312
Copy link
Member

connor4312 commented Jan 27, 2020

I'd prefer separate Github issues that reference the main one; easier to track ongoing milestones, state, and assignments at a more granular level that way.

Chrome integration tests

These aren't super useful right now. It's safe to ignore that result, we have been discussing an effort to either remove or merge the relevant cases into the main set of integration tests.

@connor4312
Copy link
Member

Let me know when you're happy merging this PR, and I'll get it in then. Note that this is endgame week for VS Code so we won't be as responsive until we normally are until Monday.

@johnemau
Copy link
Contributor Author

johnemau commented Jan 27, 2020

Thanks for the review @connor4312! This PR ready to land so please merge! 🚢 🚀

Per your suggestion I will file separate github issues for the follow-up work and reference the main Edge issue #235.

src/build/strings.ts Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
src/targets/browser/browserLauncher.ts Outdated Show resolved Hide resolved
…emoved legacy fallback port of 2015, and added '(Chromium)' suffix to Edge identifier
@connor4312 connor4312 merged commit 811b2e7 into microsoft:master Jan 28, 2020
@roblourens
Copy link
Member

Is there any way to use "edge" for the new Edge and some other id for the legacy version? I think people would go for edge over msedge by default. And how many people want to use legacy edge when the new one is available?

@dhanvikapila
Copy link
Member

dhanvikapila commented Jan 29, 2020 via email

@roblourens
Copy link
Member

I think we should use "edge" for user-facing things in VS Code and we can map it to msedge for telemetry, that's fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants