How can I create a basic browser in VB.NET or C # and execute JavaScript code inside it, and without showing the code? Because I wanted to hide my JS code.
How can I create a basic browser in VB.NET or C # and execute JavaScript code inside it, and without showing the code? Because I wanted to hide my JS code.
You can use a WPF project in C # and use
<WebBrowser x:Name="MeuNavegador" Source="MeuDocumento.html" />
to manipulate the DOM and call Javascript
You can use method
WebBrowser.InvokeScript
Example: Here is the Javascript code inside HTML.
function resize() {
alert('Hello World');
}
In WPF call:
MeuNavegador.Document.InvokeScript("resize");
During Microsoft BUILD 2018 it was announced that there will be the possibility of using EDGE as WebBrowser in WPF, WinForms, etc.