I'am trying to use the CefSharp.Wpf NuGet package (v79.1.360) to display a simple html web page from disk.
The page has dependencies to local files (javascript, css, etc. ...) in a different directory than the page itself.
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<link rel="stylesheet" type="text/css" href="file:///G:/AngularJS/Framework/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="MyApp.css">
<script src="file:///G:/AngularJS/Framework/angular.min.js"></script>
<script src="file:///G:/AngularJS/Framework/jquery.min.js"></script>
<script src="file:///G:/AngularJS/Framework/bootstrap.min.js"></script>
<script src="MyApp.js"></script>
<title></title>
</head>
<body>
<p class="font-weight-bold">Select address</p>
<table class="table table-hover">
<thead>
<tr class="bg-primary">
<th scope="col">ID</th>
<th scope="col">Name</th>
<th scope="col">Code</th>
<th scope="col">City</th>
<th scope="col">Street</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="address in Model.AddressList"
ng-click="Model.PickRow(address)"
ng-style="{'background-color': address.Background}">
<td>{{address.Id}}</td>
<td>{{address.Name}}</td>
<td>{{address.PostalCode}}</td>
<td>{{address.City}}</td>
<td>{{address.Street}}</td>
</tr>
</tbody>
</table>
</body>
</html>
I'm able to display the page on a chromium based web browser (Firefox) with modified settings: security.fileuri.strict_origin_policy false
-> Firefox isn't a chromium based web browser, so I tested it with google chrome and it worked too.
On my web research I found this post related to the issue (unfortunately this post is from 2014):
https://github.com/cefsharp/CefSharp/issues/572
So I tried to set the browser settings for the cef sharp control:
<Window x:Class="WebControl.MyWebBrowser"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:cefSharpCore="clr-namespace:CefSharp;assembly=CefSharp.Core"
xmlns:cefSharpWpf="clr-namespace:CefSharp.Wpf;assembly=CefSharp.Wpf"
Height="300" Width="300">
<Grid>
<cefSharpWpf:ChromiumWebBrowser>
<cefSharpWpf:ChromiumWebBrowser.BrowserSettings>
<cefSharpCore:BrowserSettings WebSecurity="Disabled"
FileAccessFromFileUrls="Enabled"
UniversalAccessFromFileUrls="Enabled"/>
</cefSharpWpf:ChromiumWebBrowser.BrowserSettings>
</cefSharpWpf:ChromiumWebBrowser>
</Grid>
</Window>
But this doesn't work. I also tried to set the settings in the code behind file without success.
Long story short:
Current result Expected result
If someone has a solution please let me know.
Thanks in advance for reading the post :-)