I'm using win-forms WebControl (tried also the built-in WPF browser) , and it's content are simple html and JavaScript files that defined as embedded resource.
For my POC all of the files must be Embedded.
XAML :
<Window x:Class="WebPOC.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:forms="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
Title="MainWindow" Height="350" Width="525">
<Grid>
<WindowsFormsHost>
<forms:WebBrowser x:Name="WebBrowser"/>
</WindowsFormsHost>
</Grid>
Code-Behind:
public MainWindow()
{
InitializeComponent();
var stream = Assembly.GetEntryAssembly().GetManifestResourceStream("WebPOC.www.index.html");
WebBrowser.DocumentStream = stream;
}
Web Content:
alert("test");
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<script src="js/test.js"></script>
<title></title>
</head>
<body>
<p>test</p>
</body>
</html>
For some reason the linked JavaScript file gives an error:
Any Ideas?