c# - Change WebBrowser content before document completed -
i have webbrowser control , navigating local html page. have code:
webbrowser.documentcompleted += ondomcontentloaded; public void ondomcontentloaded(object sender, eventargs e) { var browser = (sender webbrowser); if (browser != null && browser.document != null && browser.document.body != null) { var documenthtml = browser.document.body.innerhtml; browser.document.body.innerhtml = helper.modifycontent(documenthtml); } }
in helper.modifycontent modifying html content. , have 1 problem: html page loads , it's being modified (i see few milliseconds html content changing). how can change html content before it's shown in webbrowser? , can't use such methods getelementbyid() , similar.
Comments
Post a Comment