CEF browser - how to allow cross origin requests using the file:// protocol?

Mark Wilcox mark at sorcery-ltd.co.uk
Fri Jul 11 08:59:35 EDT 2014


> Now, if you use a server and http://, Keynote uses Ajax and transitions
> work fine. This means I need to remove the JSONP option and
> tell the CEF browser somehow to allow cross origin requests
> using the file:// protocol. With Chrome this can be achieved by using
> a -–allow-file-access-from-files command line switch.
> 
> Does anybody know how to set this flag for the CEF browser
> in LiveCode?

I had a very quick look at the code and I don't think it can be done
without a change to the engine. One way to do it would be to implement:
CefApp::OnBeforeCommandLineProcessing()

In revbrowser/src/cefbrowser.cpp

It could be a fixed command line argument that is added if no-one is
concerned about the security implications, otherwise some new command in
LiveCode that lets you add to this argument list before you create a new
browser object. The second option would obviously be much more flexible.

-- 
  Mark Wilcox
  mark at sorcery-ltd.co.uk





More information about the use-livecode mailing list