mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-19 06:43:51 +02:00
fix(.NET): resolve cefsharp not loading uris with special characters
Before this change, the browser would fail to navigate to the local index.html page if the path leading to the file contained any special characters. This resulted in the browser loading into a file view. This fix adds a custom URI scheme that retains the same base directory that was in use previously and sets the default file to index.html. This resolves the issue with cefsharp not loading uris with special characters.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using CefSharp;
|
||||
using CefSharp.SchemeHandler;
|
||||
using CefSharp.WinForms;
|
||||
using System;
|
||||
using System.IO;
|
||||
@@ -26,12 +27,16 @@ namespace VRCX
|
||||
PersistUserPreferences = true
|
||||
};
|
||||
|
||||
/*cefSettings.RegisterScheme(new CefCustomScheme
|
||||
cefSettings.RegisterScheme(new CefCustomScheme
|
||||
{
|
||||
SchemeName = "vrcx",
|
||||
DomainName = "app",
|
||||
SchemeHandlerFactory = new FolderSchemeHandlerFactory(Application.StartupPath + "/../../../html")
|
||||
});*/
|
||||
SchemeName = "localnjs",
|
||||
DomainName = "vrcx",
|
||||
SchemeHandlerFactory = new FolderSchemeHandlerFactory(
|
||||
rootFolder: Path.Combine(Program.BaseDirectory, "html"),
|
||||
hostName: "vrcx",
|
||||
defaultPage: "index.html"
|
||||
)
|
||||
});
|
||||
|
||||
// cefSettings.CefCommandLineArgs.Add("allow-universal-access-from-files");
|
||||
// cefSettings.CefCommandLineArgs.Add("ignore-certificate-errors");
|
||||
|
||||
Reference in New Issue
Block a user