I am trying to incorporate a browser into a console application using CefSharp Offscreen with dotnet core.
Is it possible to view the web page inside the Chromium browser this way?
In the code below (largely taken from their Offscreen github example) I am trying to display a simple HTML page (later it'll be React or Angular but for now HTML is fine).
In their code they l;oad up a webpage in Chromium and take a picture of it, I want to be able to view the webpae that it takes a screenshot of.
public static void Start()
{
//Only required for PlatformTarget of AnyCPU
AppDomain.CurrentDomain.AssemblyResolve += Resolver;
Console.WriteLine("apply cef settings");
CefSettings settings = new CefSettings();
settings.RegisterScheme(new CefCustomScheme
{
SchemeName = "localfolder",
SchemeHandlerFactory = new FolderSchemeHandlerFactory(
rootFolder: @"..\..\..\..\html",
defaultPage: "index.html"
)
});
Cef.Initialize(settings, performDependencyCheck: false, browserProcessHandler: null);
CefSharpSettings.ShutdownOnExit = true;
Console.WriteLine("load web page");
ChromeBrowser = new ChromiumWebBrowser("localfolder://cefsharp/");
Console.ReadKey();
Cef.Shutdown();
}