I have a simple custom protocol scheme that I want to use with CefSharp to "start" a file in Windows. The scheme works, but I can't find a way to prevent chromium from navigating to that file url (after it's been invoked successfully by Process.Start in the code below). I've tried just about every combination of CefReturnValue and callback.Dispose and request.Dispose
Here's the code:
public override CefReturnValue ProcessRequestAsync(IRequest request, ICallback callback)
{
var uri = new Uri(request.Url);
string requestedPath = WebUtility.UrlDecode(uri.AbsolutePath);
if (requestedPath.StartsWith("///"))
requestedPath = requestedPath.Substring(3).Replace("/", @"\");
if (File.Exists(requestedPath))
Process.Start(requestedPath);
callback.Dispose();
return CefReturnValue.Cancel;
}
Does anyone know how to prevent the subsequent navigation?