how to stop webview2 from displaying popup window

G. Gunn - fs 146 Reputation points
2023-03-07T02:33:20.48+00:00

I am developing an application using webview2. after set the source to new System.Uri("https://finance.yahoo.com/quote/"+stocksymbol) the first time in the application run, there is a popup windows from yahoo requesting to logon.

the first thought I had to to find the proper element to close it but no id or name available for the relevant buttons.

Developer technologies | C#
Developer technologies | C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 82,146 Reputation points Volunteer Moderator
    2023-03-08T16:43:51.1+00:00

    they use class names for everything. the popup is just on overlay. you could server for the div with class "YDC-Overlay", and remove or hide the div.


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.