|
@@ -3,6 +3,7 @@ using System.IO;
|
|
|
using Avalonia;
|
|
|
using Avalonia.Controls;
|
|
|
using Avalonia.Markup.Xaml;
|
|
|
+using Xilium.CefGlue;
|
|
|
using Xilium.CefGlue.Avalonia;
|
|
|
using Xilium.CefGlue.Common.Handlers;
|
|
|
|
|
@@ -32,19 +33,21 @@ namespace fis
|
|
|
{
|
|
|
platformService = new WinService();
|
|
|
}
|
|
|
- else if (Environment.OSVersion.Platform == PlatformID.MacOSX)
|
|
|
+ else if (Environment.OSVersion.Platform == PlatformID.Unix)
|
|
|
{
|
|
|
platformService = new MacService();
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- throw new NotSupportedException($"Platform {Environment.OSVersion.Platform} is not suppoorted");
|
|
|
+ throw new NotSupportedException($"Platform {Environment.OSVersion.Platform} is not suppoorted.");
|
|
|
}
|
|
|
var platformHandler = new JsonRpcHandler<IPlatformService>(ShellConfig.Instance.LocalApiHost, platformService);
|
|
|
var handler = new HostRequestHandler();
|
|
|
handler.RegisterHostHandler(appHandler);
|
|
|
handler.RegisterHostHandler(platformHandler);
|
|
|
_browser = new AvaloniaCefBrowser();
|
|
|
+ //Make cross domain work.
|
|
|
+ _browser.Settings.WebSecurity = CefState.Disabled;
|
|
|
_browser.Address = ShellConfig.Instance.AppHost;
|
|
|
_browser.RequestHandler = handler;
|
|
|
_browser.ContextMenuHandler = new TextContextMenuHandler(_browser);
|