コード例 #1
0
        protected override bool OnBeforePopup(CefBrowser browser, CefFrame frame, string targetUrl, string targetFrameName, CefWindowOpenDisposition targetDisposition, bool userGesture, CefPopupFeatures popupFeatures, CefWindowInfo windowInfo, ref CefClient client, CefBrowserSettings settings, ref CefDictionaryValue extraInfo, ref bool noJavascriptAccess)
        {
            //  return base.OnBeforePopup(browser, frame, targetUrl, targetFrameName, targetDisposition, userGesture, popupFeatures, windowInfo, ref client, settings, ref extraInfo, ref noJavascriptAccess);

            var e = new BeforePopupEventArgs(frame, targetUrl, targetFrameName, popupFeatures, windowInfo, client, settings, noJavascriptAccess);

            client             = e.Client;
            noJavascriptAccess = e.NoJavascriptAccess;
            _core.x            = windowInfo.X;
            _core.y            = windowInfo.Y;
            _core._width       = windowInfo.Width;
            _core._height      = windowInfo.Height;
            _core.InvokeIfRequired(() => _core.OnBeforePopup(e));
            return(e.Handled);
        }
コード例 #2
0
        internal protected virtual void OnBeforePopup(BeforePopupEventArgs e)
        {
            if (e.TargetUrl != "about:blank")
            {
                popupurl = false;
            }

            if (BeforePopup != null)
            {
                // e.Handled = true;
                BeforePopup(this, e);
            }
            else
            {
                e.Handled = false;
            }
        }