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

IHTMLDocument2 equivalent in WebView2 #1650

Closed
hakzhyena opened this issue Aug 16, 2021 · 1 comment
Closed

IHTMLDocument2 equivalent in WebView2 #1650

hakzhyena opened this issue Aug 16, 2021 · 1 comment

Comments

@hakzhyena
Copy link

Hi,

I am updating our codebase (written in C++) to move from WebBrowser Control to WebView2 control.
I see that currently while handling dispatch id DISPID_DOCUMENTCOMPLETE (document completed event), we are trying to QueryInterface 'IID_IHTMLDocument2' interface and then using it for operations such as get_title etc.

I am trying to use add_DOMContentLoaded for handling document completed event. I hope this is the equivalent. Please correct me if I am wrong.

Also, I could not find any equivalent for IID_IHTMLDocument2. Can you please let me know the same?

@champnic
Copy link
Member

Hey @hakzhyena - yes the add_DOMContentLoaded event should be equivalent.

We don't have direct programmatic support for the DOM like IHTMLDocument2 provides- instead you can execute script to get the behaviors you need using ICoreWebView2::ExecuteScript. We are tracking this feature ask in #77. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants