Page 1 of 1

Unknown URL for file:// URLs

PostPosted: Fri Jun 11, 2021 9:23 am
by sjames1958
I am trying to utilize file:// urls in my application. I am getting Failed to load resource: net::ERR_UNKNOWN_URL_SCHEME
I have
command_line->AppendSwitch("allow-file-access-from-files");
In OnBeforeCommandLineProcessing in my app - but this does not seem to have any impact on processing?

Mac OS (big Sur)
CEF version - 87.1.14+ga29e9a3

Re: Unknown URL for file:// URLs

PostPosted: Fri Jun 11, 2021 10:07 am
by magreenblatt
What, specifically, are you trying to do with file:// URLs?

Re: Unknown URL for file:// URLs

PostPosted: Fri Jun 11, 2021 10:45 am
by sjames1958
A local video file (.webm) is shown to our user.
We recently moved from an old 2017 CEF to late 2020 CEF and before we used file:// URLs and would let the browser handle (return NULL from GetResourceHandler)
We had to change to localhost http:// URLs with this version and pass the file data back with CefStreamResourceHandler
However, with this mechanism, the seeking on the video element no longer works.
So, I was attempting to return to file:// URLs and ran into this issue.

Re: Unknown URL for file:// URLs

PostPosted: Tue Jun 15, 2021 9:57 am
by sjames1958
Shouldn't
command_line->AppendSwitch("allow-file-access-from-files");
allow for the file:// URL Scheme to be recognized in the renderer?

Re: Unknown URL for file:// URLs

PostPosted: Tue Jun 15, 2021 10:11 am
by magreenblatt
How does it behave in Google Chrome at the same version?

Re: Unknown URL for file:// URLs

PostPosted: Wed Jun 16, 2021 1:59 am
by ndesktop
Should not be with triple slash, i.e. file:///C:/ instead of file://C:/ ?
Latest Chrome I have (91.0.4472.101) works normally with file://C:/ (replaces with file:///C:/) and displays the content of C:, as well as cefclient 90.6.7 (90.0.4430.212).

Re: Unknown URL for file:// URLs

PostPosted: Sat Jul 17, 2021 2:57 am
by kikiako
I ran into the same problem. When i get file:// URLs in my app based on cefclient, "Unknown URL for file:// URLs" error will be reported. The file protocol uses the default processing(my cef3 chromium 80+).But when entering the address (file:/// path/test.mp4) in the navigation bar of cefclient, it plays the video normally .