To load an HTML document, simply compile the html file as an embedded resource, and then:
WebBrowser browser = new WebBrowser(); browser.DocumentText = Properties.Resources.<your_html_file>;
If you really need external .js files, I think you will probably need to make them inline resources. You can then read these resources in a javascript line.
string GetResourceString(string scriptFile) { Assembly assembly = Assembly.GetExecutingAssembly(); Stream str = assembly.GetManifestResourceStream(scriptFile); StreamReader sr = new StreamReader(str, Encoding.ASCII)); return sr.ReadToEnd(); }
(Adapted from the answer on this page )
Next, consider the IHTMLScriptElement. As far as I understand, you can use this javascript line and set it as an ITHMLScriptElement text field. See this question
Good luck.
source share