Example #1
0
        protected override bool OnBeforeBrowse(CefBrowser browser, CefFrame frame, CefRequest request, bool userGesture, bool isRedirect)
        {
            if (frame.IsMain)
            {
                var region = _owner.WebView?.DraggableRegion;

                if (region != null)
                {
                    region.Dispose();
                    _owner.WebView.DraggableRegion = null;
                }

                //_owner.WebView.WebViewIsReady = false;
            }

            _owner.WebView.ProcessMessageBridge.OnBeforeBrowse(browser, frame);


            var e = new BeforeBrowseEventArgs(browser, frame, request, userGesture, isRedirect);


            _owner.InvokeIfRequired(() => _owner.OnBeforeBrowse(e));

            return(e.Cancelled);
        }