Hello, first of all thank you for this useful component.
I was using TWebBrowser in my project and I could reach an element on the page with its Id and change its content (GetElementbyId).
How can I do this with WebView4Delphi?
Thanks
Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.
how change html content?
- salvadordf
- Posts: 4620
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: how change html content?
Hi,
As far as I know, WebView2 doesn't expose any API method to access the DOM directly.
However, you can execute some custom JavaScript code that searches for that element and sends the information you need to the Delphi application with a message.
See the BrowserHostAppCommunication demo for all the details about sending messages between the browser and Delphi.
As far as I know, WebView2 doesn't expose any API method to access the DOM directly.
However, you can execute some custom JavaScript code that searches for that element and sends the information you need to the Delphi application with a message.
See the BrowserHostAppCommunication demo for all the details about sending messages between the browser and Delphi.
Re: how change html content?
Thanks for reply, i do it with your suggestion ..salvadordf wrote: Wed Dec 29, 2021 2:24 pm Hi,
As far as I know, WebView2 doesn't expose any API method to access the DOM directly.
However, you can execute some custom JavaScript code that searches for that element and sends the information you need to the Delphi application with a message.
See the BrowserHostAppCommunication demo for all the details about sending messages between the browser and Delphi.