https://github.com/eligrey/FileSaver.js ... leSaver.js
The javascript and html files are loaded from a windows network share location. It works fine as long as the javascript files are loaded from an url html file location specified like this (non UNC):
- Code: Select all
file:///G://tmp/index.html
... but if I use the windows network share UNC name for the exact same file location :
- Code: Select all
file:///cit-nas1/DATA/GROUPS/ABC/tmp/index.html
... it fails at this statement, and the browser seems to crash :
a.href = URL.createObjectURL(blob)
..blob is a javscript blob with content type: text/csv;charset=utf-8
The normal functionality is just to allow saving of this text data as a file locally on the users' PC, but what actually happens is a 'blank' page in the browser and devtools get disconnected so I cannot see an error message.
In the C# application the chromium web browser is created as follows :
- Code: Select all
var browser = new ChromiumWebBrowser(url)
{
BrowserSettings = new BrowserSettings
{
FileAccessFromFileUrls = CefState.Enabled,
UniversalAccessFromFileUrls = CefState.Enabled,
WebSecurity = CefState.Disabled,
TextAreaResize = CefState.Disabled
},
Dock = DockStyle.Fill
};
browser.MenuHandler = new MenuHandler();
browser.RequestHandler = new CoreRequestHandler();
browser.JsDialogHandler = new JsDialogHandler();
browser.DownloadHandler = new DownloadHandler();
browser.LifeSpanHandler = new CustomLifeSpanHandler();
browser.FocusHandler = new FocusHandler(browser, urlTextBox);
browser.LoadError += OnLoadError;
I need to use the network share name. It feels like a security issue or maybe a bug. I cannot find out what to do to make it work. Can anyone offer a solution ? It worked in my previously used CefSharp v57.0.0.0 with the exact same javascript, html and c# code.