Webview not working in Windows7 OS

test code 21 Reputation points
2025-08-06T13:11:12.1233333+00:00

In my WebView2 application, I am navigating to a URL from CoreWebView2.NewWindowRequested event 

Private Async Sub NewWindowRequested1(sender As Object, e As CoreWebView2NewWindowRequestedEventArgs)
        Try
            WebView2.CoreWebView2.Navigate(e.Uri)
            e.NewWindow = WebView2.CoreWebView2
            e.Handled = True

However, I am unable to perform any click actions using JavaScript, and built-in events such as SourceChanged and NavigationCompleted are also not being triggered.

This issue occurs only on Windows 7. On other operating systems, all actions and events work as expected with the same URL.

I have tried reinstalling WebView2 Runtime version 109 on the Windows 7 system, but the issue persists.

Additionally, when I attempt to perform a click action using JavaScript from the browser console, I receive an error.

Error description :-

Uncaught TypeError: Cannot read properties of undefined (reading 'postMessage')     at <anonymous>:1:342     at l.invokeTask (polyfills.ecf155311458d67f4990.js:1:7920)     at i.runTask (polyfills.ecf155311458d67f4990.js:1:3329)     at invokeTask (polyfills.ecf155311458d67f4990.js:1:8970)     at invoke (polyfills.ecf155311458d67f4990.js:1:8872)     at n.args.<computed> (polyfills.ecf155311458d67f4990.js:1:32844)

My WebView2 is initialized properly, and also CoreWebView2.NewWindowRequested code is working for other website in same PC.

How to resolve this issue?

Webview runtime version: - 109.0.1518.140

Microsoft Edge | Other | Previous Windows versions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Jay Pham (WICLOUD CORPORATION) 3,305 Reputation points Microsoft External Staff Moderator
    2025-08-15T02:43:17.09+00:00

    Hello test code,

    Thanks for reaching out to Microsoft Q&A. Based on the information you provided, your application uses WebView2 to navigate to a URL via the CoreWebView2.NewWindowRequested event. However, on Windows 7, JavaScript interactions such as click actions do not work, and built-in events like SourceChanged and NavigationCompleted are not triggered, even though everything works fine on other operating systems.

    The main reason is that WebView2 only supports Windows 7 up to runtime version 109. After January 2023, Microsoft stopped updating and supporting WebView2 for Windows 7. As a result, many modern APIs and features of WebView2—especially those related to window management, events, and advanced JavaScript interactions—will not function fully or may throw errors on Windows 7. The JavaScript error you encountered, Uncaught TypeError: Cannot read properties of undefined (reading 'postMessage'), is also related to missing or limited platform APIs in Windows 7.

    The best solution is to upgrade your operating system to Windows 10 or Windows 11 to receive full support and features from WebView2. If you must use Windows 7, you should only use WebView2 for displaying static web content, avoid advanced events or complex JavaScript interactions, or consider using the older WebBrowser control (based on Internet Explorer), though this comes with its own limitations in web technology support.

    References:

    If you need more specific guidance on handling or refactoring your code, please provide more details about your use case.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.