UWP: Clicking and scrolling doesn't work on some web pages or in iframes

Symptoms

Cause

When Native 2D Mode is disabled, 3D WebView for UWP / Hololens has a limitation where it's unable to click or scroll in HTML <iframe> elements. So, if you encounter an issue where clicking and scrolling doesn't work on a specific web page, it's probably because the page uses an <iframe> element.

3D WebView for UWP / Hololens is powered by the UWP WebView control. The UWP WebView control doesn't provide a native API to programmatically dispatch mouse input, so 3D WebView for UWP implements clicking and scrolling by executing JavaScript in the page. Unfortunately, the UWP WebView control doesn't provide a way to run JavaScript within an <iframe>, so 3D WebView is unable to dispatch click or scroll events within iframes.

Resolution

If you're displaying web content in 2D and not targeting Mixed Reality headsets like Hololens, then you can avoid the issue by enabling Native 2D Mode. There's not currently a solution to resolve the issue for the default 3D rendering mode, but I'm tracking this issue and will update this article if I find a solution in the future. In the meantime, a potential workaround could be to load the iframe's URL directly into the webview (e.g. with IWebView.LoadUrl()) instead of loading the page that embeds it in an iframe.