<script type="text/javascript" src="http://internal/helper.js"></script>
However, it doesn't work for some reason and I have tried without the custom link like
<script type="text/javascript" src="helper.js"></script>
and still received the same error - ["Uncaught ReferenceError: showAlert is not defined", source: http://internal/tests.html
My code is built on top of cefsimple example, and there is no custom scheme has been defined, I have a method to load resource based on mine type (ParseTestUrl method), that's why loading http://internal/index.html works fine
- Code: Select all
CefRefPtr<CefResourceHandler> SimpleHandler::GetResourceHandler(
CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
CefRefPtr<CefRequest> request) {
std::string url = request->GetURL();
if (url.find(kInternalOrigin) == 0) {
// Handle URLs in the test origin.
std::string file_name, mime_type;
if (ParseTestUrl(url, &file_name, &mime_type)) {
// Load the resource from file.
CefRefPtr<CefStreamReader> stream =
GetBinaryResourceReader(file_name.c_str());
if (stream.get())
return new CefStreamResourceHandler(mime_type, stream);
}
}
return NULL;
}
Could anyone shed some light on what I did wrong? What would be the best way to achieve my goal without having to define custom scheme?
Thanks in advance.