protected override bool ProcessRequest(CefRequest request, CefCallback callback)
        {
            var isSchemeRegistered = _requestSchemeProvider?.IsSchemeRegistered(request.Url);

            if (isSchemeRegistered.HasValue && isSchemeRegistered.Value)
            {
                var uri  = new Uri(request.Url);
                var path = uri.LocalPath;

                bool isRequestAsync = _routeProvider.IsActionRouteAsync(path);
                if (isRequestAsync)
                {
                    ProcessRequestAsync(path);
                }
                else
                {
                    ProcessRequest(path);
                }

                return(true);
            }
            else
            {
                _chromelyResponse = _chromelyErrorHandler.HandleRouteNotFound(request.Identifier.ToString(), request.Url);
                string jsonData = _serializerUtil.EnsureResponseDataIsJson(_chromelyResponse.Data);
                _responseBytes = Encoding.UTF8.GetBytes(jsonData);
            }

            callback.Dispose();
            return(false);

            #region Process Request

            void ProcessRequest(string path)
            {
                Task.Run(() =>
                {
                    using (callback)
                    {
                        try
                        {
                            if (string.IsNullOrWhiteSpace(path))
                            {
                                _chromelyResponse = _chromelyErrorHandler.HandleRouteNotFound(request.Identifier.ToString(), path);
                                string jsonData   = _serializerUtil.EnsureResponseDataIsJson(_chromelyResponse.Data);
                                _responseBytes    = Encoding.UTF8.GetBytes(jsonData);
                            }
                            else
                            {
                                var parameters = request.Url.GetParameters(request.ReferrerURL);
                                var postData   = GetPostData(request);

                                var jsonRequest   = _serializerUtil.ObjectToJson(request);
                                _chromelyResponse = _requestTaskRunner.Run(request.Identifier.ToString(), path, parameters, postData, jsonRequest);
                                string jsonData   = _serializerUtil.EnsureResponseDataIsJson(_chromelyResponse.Data);
                                _responseBytes    = Encoding.UTF8.GetBytes(jsonData);
                            }
                        }
                        catch (Exception exception)
                        {
                            var chromelyRequest = new ChromelyRequest()
                            {
                                Id = request.Identifier.ToString(), RouteUrl = request.Url
                            };
                            _chromelyResponse = _chromelyErrorHandler.HandleError(chromelyRequest, exception);
                            string jsonData   = _serializerUtil.EnsureResponseDataIsJson(_chromelyResponse.Data);
                            _responseBytes    = Encoding.UTF8.GetBytes(jsonData);
                        }
                        finally
                        {
                            callback.Continue();
                        }
                    }
                });
            }

            #endregion

            #region Process Request Async

            void ProcessRequestAsync(string path)
            {
                Task.Run(async() =>
                {
                    using (callback)
                    {
                        try
                        {
                            if (string.IsNullOrWhiteSpace(path))
                            {
                                _chromelyResponse = _chromelyErrorHandler.HandleRouteNotFound(request.Identifier.ToString(), path);
                                string jsonData   = _serializerUtil.EnsureResponseDataIsJson(_chromelyResponse.Data);
                                _responseBytes    = Encoding.UTF8.GetBytes(jsonData);
                            }
                            else
                            {
                                var parameters = request.Url.GetParameters(request.ReferrerURL);
                                var postData   = GetPostData(request);

                                var jsonRequest   = _serializerUtil.ObjectToJson(request);
                                _chromelyResponse = await _requestTaskRunner.RunAsync(request.Identifier.ToString(), path, parameters, postData, jsonRequest);
                                string jsonData   = _serializerUtil.EnsureResponseDataIsJson(_chromelyResponse.Data);

                                _responseBytes = Encoding.UTF8.GetBytes(jsonData);
                            }
                        }
                        catch (Exception exception)
                        {
                            var chromelyRequest = new ChromelyRequest()
                            {
                                Id = request.Identifier.ToString(), RouteUrl = request.Url
                            };
                            _chromelyResponse = _chromelyErrorHandler.HandleError(chromelyRequest, exception);
                            string jsonData   = _serializerUtil.EnsureResponseDataIsJson(_chromelyResponse.Data);
                            _responseBytes    = Encoding.UTF8.GetBytes(jsonData);
                        }
                        finally
                        {
                            callback.Continue();
                        }
                    }
                });
            }

            #endregion
        }
        protected override bool ProcessRequest(CefRequest request, CefCallback callback)
        {
            var isSchemeRegistered = _requestSchemeProvider?.IsSchemeRegistered(request.Url);

            if (isSchemeRegistered.HasValue && isSchemeRegistered.Value)
            {
                var uri  = new Uri(request.Url);
                var path = uri.LocalPath;

                bool isRequestAsync = _routeProvider.IsActionRouteAsync(path);
                if (isRequestAsync)
                {
                    ProcessRequestAsync(path);
                }
                else
                {
                    ProcessRequest(path);
                }

                return(true);
            }

            Logger.Instance.Log.LogWarning($"Url {request.Url} is not of a registered custom scheme.");
            callback.Dispose();
            return(false);

            #region Process Request

            void ProcessRequest(string path)
            {
                Task.Run(() =>
                {
                    using (callback)
                    {
                        try
                        {
                            var response = new ChromelyResponse();
                            if (string.IsNullOrEmpty(path))
                            {
                                response.ReadyState = (int)ReadyState.ResponseIsReady;
                                response.Status     = (int)HttpStatusCode.BadRequest;
                                response.StatusText = "Bad Request";

                                _chromelyResponse = response;
                            }
                            else
                            {
                                var parameters = request.Url.GetParameters();
                                var postData   = GetPostData(request);

                                var jsonRequest   = _serializerUtil.ObjectToJson(request);
                                _chromelyResponse = _requestTaskRunner.Run(request.Identifier.ToString(), path, parameters, postData, jsonRequest);
                                string jsonData   = _serializerUtil.EnsureResponseDataIsJson(_chromelyResponse.Data);
                                _responseBytes    = Encoding.UTF8.GetBytes(jsonData);
                            }
                        }
                        catch (Exception exception)
                        {
                            Logger.Instance.Log.LogError(exception, exception.Message);

                            _chromelyResponse =
                                new ChromelyResponse
                            {
                                Status = (int)HttpStatusCode.BadRequest,
                                Data   = "An error occured."
                            };
                        }
                        finally
                        {
                            callback.Continue();
                        }
                    }
                });
            }

            #endregion

            #region Process Request Async

            void ProcessRequestAsync(string path)
            {
                Task.Run(async() =>
                {
                    using (callback)
                    {
                        try
                        {
                            var response = new ChromelyResponse();
                            if (string.IsNullOrEmpty(path))
                            {
                                response.ReadyState = (int)ReadyState.ResponseIsReady;
                                response.Status     = (int)System.Net.HttpStatusCode.BadRequest;
                                response.StatusText = "Bad Request";

                                _chromelyResponse = response;
                            }
                            else
                            {
                                var parameters = request.Url.GetParameters();
                                var postData   = GetPostData(request);

                                var jsonRequest   = _serializerUtil.ObjectToJson(request);
                                _chromelyResponse = await _requestTaskRunner.RunAsync(request.Identifier.ToString(), path, parameters, postData, jsonRequest);
                                string jsonData   = _serializerUtil.EnsureResponseDataIsJson(_chromelyResponse.Data);

                                _responseBytes = Encoding.UTF8.GetBytes(jsonData);
                            }
                        }
                        catch (Exception exception)
                        {
                            Logger.Instance.Log.LogError(exception, exception.Message);

                            _chromelyResponse =
                                new ChromelyResponse
                            {
                                Status = (int)HttpStatusCode.BadRequest,
                                Data   = "An error occured."
                            };
                        }
                        finally
                        {
                            callback.Continue();
                        }
                    }
                });
            }

            #endregion
        }