Unknown URL for file:// URLs

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Unknown URL for file:// URLs

Postby sjames1958 » Fri Jun 11, 2021 9:23 am

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
sjames1958
Techie
 
Posts: 37
Joined: Sun Jun 22, 2014 7:41 am

Re: Unknown URL for file:// URLs

Postby magreenblatt » Fri Jun 11, 2021 10:07 am

What, specifically, are you trying to do with file:// URLs?
magreenblatt
Site Admin
 
Posts: 10939
Joined: Fri May 29, 2009 6:57 pm

Re: Unknown URL for file:// URLs

Postby sjames1958 » Fri Jun 11, 2021 10:45 am

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.
sjames1958
Techie
 
Posts: 37
Joined: Sun Jun 22, 2014 7:41 am

Re: Unknown URL for file:// URLs

Postby sjames1958 » Tue Jun 15, 2021 9:57 am

Shouldn't
command_line->AppendSwitch("allow-file-access-from-files");
allow for the file:// URL Scheme to be recognized in the renderer?
sjames1958
Techie
 
Posts: 37
Joined: Sun Jun 22, 2014 7:41 am

Re: Unknown URL for file:// URLs

Postby magreenblatt » Tue Jun 15, 2021 10:11 am

How does it behave in Google Chrome at the same version?
magreenblatt
Site Admin
 
Posts: 10939
Joined: Fri May 29, 2009 6:57 pm

Re: Unknown URL for file:// URLs

Postby ndesktop » Wed Jun 16, 2021 1:59 am

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).
ndesktop
Master
 
Posts: 558
Joined: Thu Dec 03, 2015 10:10 am

Re: Unknown URL for file:// URLs

Postby kikiako » Sat Jul 17, 2021 2:57 am

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 .
kikiako
Newbie
 
Posts: 9
Joined: Mon Jun 21, 2021 12:05 pm


Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 17 guests