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) { frame.LoadUrl(targetUrl); return(true); }
public void OnLoadEnd(CefBrowser browser, CefFrame frame, int httpStatusCode) { // main frame if (frame.IsMain) { string base64EncodedCss = "data:text/css;charset=utf-8;base64,"; base64EncodedCss += Convert.ToBase64String(Encoding.UTF8.GetBytes( BrowserConfig.BrowserSourceSettings.CSS)); string script = "" + "document.location.href = \"" + BrowserConfig.BrowserSourceSettings.LoadUrl + "\";"; if (loadUrl) { API.Instance.Log("Sleeping for 500 ms as seen some bug where page load gives error"); Thread.Sleep(500); loadUrl = false; API.Instance.Log("Loading url : " + BrowserConfig.BrowserSourceSettings.LoadUrl); frame.LoadUrl(BrowserConfig.BrowserSourceSettings.LoadUrl); } } }
public void LoadUrl(string url) { mainFrame.LoadUrl(url); }