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
[FileExplorerPreview] Move everything from WebBrowser to WebView2 #17588
Conversation
I think if we want one we should create our own because of elemts like back and forward and inspect which we don't want
My suggestion would be to execute JavaScript from the C# code (https://docs.microsoft.com/en-us/microsoft-edge/webview2/how-to/javascript) which adds a |
Open links in default browser
I disabled context menu for now, as it didn't exist previously. |
This comment was marked as resolved.
This comment was marked as resolved.
Remove WebBrowser related stuff
Disable javascript dialogs in WebView2 for Svg thumbnail and preview
This comment was marked as resolved.
This comment was marked as resolved.
This should be fully ready for review now. Tests are fixed. |
Maybe I can do this this week(end). Do you want it in this PR? |
Great, thanks! If this doesn't get merged until then, then you can add it to this PR. |
8333726
to
8e9f95c
Compare
8e9f95c
to
2496696
Compare
This issue can be linked: #15764 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some nits.
I also see some of the tests have been removed. No longer needed or is there no equivalent call in WebView 2?
Do we need to add something more to the installer for this to work?
{ | ||
// We are not the appropriate size for caller. Resize now while | ||
// respecting the aspect ratio. | ||
float scale = Math.Min((float)cx / thumbnail.Width, (float)cx / thumbnail.Height); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add a divide by 0 check here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added
|
||
while (markdownPreviewHandlerControl.Controls.Count == 0 && Environment.TickCount < beforeTick + TenSecondsInMilliseconds) | ||
{ | ||
Application.DoEvents(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps a little sleep here to not use 100% CPU would be good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added sleeps everywhere
src/modules/previewpane/UnitTests-MarkdownPreviewHandler/MarkdownPreviewHandlerTest.cs
Show resolved
Hide resolved
src/modules/previewpane/UnitTests-MarkdownPreviewHandler/MarkdownPreviewHandlerTest.cs
Show resolved
Hide resolved
Actually, #17527 is not fixed by this, my bad. |
removed |
@stefansjfw When I do it. Is it ok to just commit against your branch? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thank you!
Ok I guess then I make my own PR. |
@Aaron-Junker , let's make that a separate PR ;) |
Summary of the Pull Request
FIXED: Why WIP? Same issue as with Monaco, can't test it properly because of all of the async stuff going on while initializing WebView environment. Looking into this...
What is this about:
OPEN QUESTIONS:
@Aaron-Junker Do you know how to do this? EDIT: Links are now opened in default browser
What is included in the PR:
How does someone test / validate:
Quality Checklist
Contributor License Agreement (CLA)
A CLA must be signed. If not, go over here and sign the CLA.