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

"edge://about" URI is working in WebView2 #604

Closed
VijayanRamachandran opened this issue Nov 6, 2020 · 5 comments
Closed

"edge://about" URI is working in WebView2 #604

VijayanRamachandran opened this issue Nov 6, 2020 · 5 comments
Labels
bug Something isn't working tracked We are tracking this work internally.

Comments

@VijayanRamachandran
Copy link

VijayanRamachandran commented Nov 6, 2020

In a sample WPF application, i hosted a single instance of WebView2 as below and passed "source" url as "edge://about"

image

Expectation:
"edge://about" should be blocked as explained in the below release notes ( as Blocked "edge://URI scheme" in WebView )
https://docs.microsoft.com/en-us/microsoft-edge/webview2/releasenotes#09579

Current Behavior:
It is displaying the "edge://about" page as shown in below screenshot.

image

Version Information
Nuget - Microsoft.Web.WebView2 => 1.0.674-prerelease
Fixed Version: Microsoft.WebView2.FixedVersionRuntime.87.0.664.8.x64

AB#30158338

@VijayanRamachandran VijayanRamachandran added the bug Something isn't working label Nov 6, 2020
@davidborka
Copy link

The same applies to the following URLs "chrome://about". Please block this one also.

@pagoe-msft pagoe-msft added the tracked We are tracking this work internally. label Nov 6, 2020
@pagoe-msft
Copy link

@VijayanRamachandran @davidborka

Thanks! I've filed a bug and we'll fix this.

@davidborka
Copy link

davidborka commented Nov 9, 2020

I would like to mention here if you trying to reach the following URI (edge:\\, chrome:\\) then the whole application is crashing.
See the following exception.:

Application: WpfTIUXPreviewApp.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.Runtime.InteropServices.COMException
at Microsoft.Web.WebView2.Core.Raw.ICoreWebView2Controller.set_Bounds(Microsoft.Web.WebView2.Core.Raw.tagRECT)
at Microsoft.Web.WebView2.Core.CoreWebView2Controller.set_Bounds(System.Drawing.Rectangle)
at Microsoft.Web.WebView2.Wpf.WebView2.OnWindowPositionChanged(System.Windows.Rect)
at System.Windows.Interop.HwndHost.UpdateWindowPos()
at System.Windows.ContextLayoutManager.fireLayoutUpdateEvent()
at System.Windows.ContextLayoutManager.UpdateLayout()
at System.Windows.ContextLayoutManager.UpdateLayoutCallback(System.Object)
at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
at System.Windows.Media.MediaContext.RenderMessageHandlerCore(System.Object)
at System.Windows.Media.MediaContext.RenderMessageHandler(System.Object)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(System.Object)
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at MS.Internal.CulturePreservingExecutionContext.Run(MS.Internal.CulturePreservingExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Windows.Threading.DispatcherOperation.Invoke()
at System.Windows.Threading.Dispatcher.ProcessQueue()
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
at MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(System.Windows.Interop.MSG ByRef)
at System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame)
at System.Windows.Application.RunDispatcher(System.Object)
at System.Windows.Application.RunInternal(System.Windows.Window)
at WpfTIUXPreviewApp.App.Main()

@champnic
Copy link
Member

"edge://about" and a bunch of other "edge://" urls are still reachable - we only blocked a subset that wouldn't make sense in a WebView2 context (like browser Settings, History, etc.). We've updated the release notes to indicate that not all are blocked, and are planning documentation to have more detail on which are blocked and which are still accessible.

If you want to block your users from accessing these urls yourself, you can use the NavigationStarting event and cancel the navigation.

@davidborka We're tracking the "edge://" crash separately and are going to look at it in the next sprint hopefully.

Thanks!

@champnic
Copy link
Member

@davidborka The "edge://" should now be fixed in the latest Microsoft Edge Canary (90.0.815.0+) builds. Please let me know if you are still running into it and we can take another look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working tracked We are tracking this work internally.
Projects
None yet
Development

No branches or pull requests

4 participants