You can call methods (and thus pass data) to your C # code from JavaScript using Window.external . Try searching this search query keyword. Additional information will appear quickly.
This blog post has a nice, simple (WPF-) example on how to call the C # method from JavaScript using Window.external . Another keyword here is [System.Runtime.InteropServices.ComVisibleAttribute(True)] . You must mark your handler class with such an attribute that it is accessible from JavaScript. And finally, you tell your WebBrowser control about the handler class through its ObjectForScripting property.
source share