I would like create a CEF enabled application that supports user generated plugins, similar to the spotify implementation. I do not know the mime type of the files included in a plugin unless I opened and read the file contents. I would like to register a domain for each plugin on my custom scheme i.e. app://plugin1/index.html. Plugins would not ship with the application, they would be downloaded and saved to the application data/plugin folder. I would like to convert the app://plugin1/index.html url into a file:// url then have chromium or cef load the contents (no redirect, the address bar should be in the plugin1 scope and not reveal the local file path).
- Code: Select all
class ApplicationPluginSchemeHandlerFactory : public CefResourceHandler {
private:
CefString plugin_;
public:
virtual bool ProcessRequest(CefRefPtr<CefRequest> request,
CefRefPtr<CefCallback> callback)
OVERRIDE {
REQUIRE_IO_THREAD();
// load file:///C:/Users/build/Release/plugins/plugin_/index.html
Is it currently possible to kick resource processing back to chromium rather than the scheme handler factory accessing plugin files directly? (I do not want to open the file, read contents and determine mime type myself. I'm guessing chromium framework is capable of doing this as-is.)
Any advise is much appreciated!