// Credits for this class go to the creator of OpenGeckoSharp and Daedalus, Eric Dong public static bool IsSitePhishing(WebKitBrowser browser, bool paypal = true, bool TaoBao = true, bool AliPay = true, bool FB = true) { if (paypal) { if (checkPaypal(browser) == true) { return(true); } } if (checkTaobao(browser) == true) { if (TaoBao) { return(true); } } if (AliPay) { if (checkAlipay(browser) == true) { return(true); } } if (checkFacebook(browser) == true) { if (FB) { return(true); } } return(false); }
string ProcessXPath(string path) { try { var jsstr = "document.evaluate( \"" + path + "\", document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue."; if (path.Contains("text()")) { jsstr += "nodeValue"; } else { jsstr += "innerHTML"; } var val = WebKitBrowser.StringByEvaluatingJavaScriptFromString(jsstr).Trim().Trim('"'); return(val); } catch (Exception ex) { return(string.Empty); } }
//初期処理 public void init(string addinType, string filePath) { if (addinType.Equals("administrator")) { //WebKitのインスタンスを作成する webBrowser1 = new WebKitBrowser(); //WebKitのインスタンスをWindowsFormsHostに割り当てる windowsFormsHost1.Child = webBrowser1; //imageは使わないので非表示に image1.Visibility = System.Windows.Visibility.Hidden; //読み込ませる webBrowser1.Url = new Uri(filePath); } else { //WindowsFormsHostは使わないので非表示に windowsFormsHost1.Visibility = System.Windows.Visibility.Hidden; //image1に表示 BitmapImage bmp = new BitmapImage(); bmp.BeginInit(); bmp.UriSource = new Uri(filePath); bmp.EndInit(); image1.Source = bmp; } }
public void setCallback(SensorCallback callback, WebKitBrowser webView) { this.callback = callback; thread = new Thread(new ThreadStart(run)); thread.SetApartmentState(ApartmentState.STA); thread.IsBackground = true; }
private void Form2_Load(object sender, EventArgs e) { WebKit.WebKitBrowser browser = new WebKitBrowser(); browser.Dock = DockStyle.Fill; this.Controls.Add(browser); browser.Navigate("http://www.baidu.com"); }
void AddEvents(WebKitBrowser browser) { browser.Navigating += new WebKitBrowserNavigatingEventHandler(webKitBrowser1_Navigating); browser.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(webKitBrowser1_DocumentCompleted); browser.CanGoBackChanged += new CanGoBackChanged(webKitBrowser1_CanGoBackChanged); browser.GeolocationPositionRequest += new GeolocationRequest(browser_GeolocationPositionRequest); browser.CanGoForwardChanged += new CanGoForwardChanged(webKitBrowser1_CanGoForwardChanged); browser.CloseWindowRequest += new EventHandler(webKitBrowser1_CloseWindowRequest); browser.DangerousSiteDetected += new EventHandler(webKitBrowser1_DangerousSiteDetected); browser.DocumentTitleChanged += new EventHandler(webKitBrowser1_DocumentTitleChanged); browser.FaviconAvailable += new FaviconAvailable(webKitBrowser1_FaviconAvaiable); browser.HeadersAvailable += new HeadersAvailableEventHandler(browser_HeadersAvailable); browser.FormSubmit += new WillSubmitForm(webKitBrowser1_FormSubmit); browser.NewWindowCreated += new NewWindowCreatedEventHandler(webKitBrowser1_NewWindowCreated); browser.PopupCreated += new NewWindowCreatedEventHandler(webKitBrowser1_PopupCreated); browser.ProgressChanged += new WebKit.ProgressChangedEventHandler(webKitBrowser1_ProgressChanged); browser.ShowJavaScriptAlertPanel += new ShowJavaScriptAlertPanelEventHandler(webKitBrowser1_ShowJavaScriptAlertPanel); browser.ShowJavaScriptConfirmPanel += new ShowJavaScriptConfirmPanelEventHandler(webKitBrowser1_ShowJavaScriptConfirmPanel); browser.ShowJavaScriptPromptBeforeUnload += new ShowJavaScriptPromptBeforeUnloadEventHandler(webKitBrowser1_ShowJavaScriptPromptBeforeUnload); browser.ShowJavaScriptPromptPanel += new ShowJavaScriptPromptPanelEventHandler(webKitBrowser1_ShowJavaScriptPromptPanel); browser.StatusTextChanged += new StatusTextChanged(webKitBrowser1_StatusTextChanged); browser.CustomContextMenuManager.ShowContextMenu += new ShowContextMenu(CustomContextMenuManager_ShowContextMenu); browser.ResourceIntercepter.ResourceSizeAvailableEvent += new ResourceSizeAvailable(ResourceIntercepter_ResourceProgressChangedEvent); browser.ResourceIntercepter.ResourceFinishedLoadingEvent += new ResourceFinishedLoadingHandler(ResourceIntercepter_ResourceFinishedLoadingEvent); browser.ResourceIntercepter.ResourceStartedLoadingEvent += new ResourceStartedLoadingHandler(ResourceIntercepter_ResourceStartedLoadingEvent); browser.ResourceIntercepter.ResourcesSendRequest += new ResourceSendRequestEventHandler(ResourceIntercepter_ResourcesSendRequest); browser.ResourceIntercepter.ResourceFailedLoading += new ResourceFailedHandler(ResourceIntercepter_ResourceFailedLoading); }
// Credits for this class go to the creator of OpenGeckoSharp and Daedalus, Eric Dong public static bool IsSitePhishing(WebKitBrowser browser, bool paypal = true, bool TaoBao = true, bool AliPay = true, bool FB = true) { if (paypal) { if (checkPaypal(browser) == true) { return true; } } if (checkTaobao(browser) == true) { if (TaoBao) { return true; } } if (AliPay) { if (checkAlipay(browser) == true) { return true; } } if (checkFacebook(browser) == true) { if (FB) { return true; } } return false; }
private void Form1_Load(object sender, EventArgs e) { WebKitBrowser browser = new WebKitBrowser(); browser.Dock = DockStyle.Fill; this.Controls.Add(browser); browser.Navigate("http://html5test.com/"); }
private void Form1_Load(object sender, EventArgs e) { WebKitBrowser Browser = new WebKitBrowser(); Browser.Url = new Uri("http://39.105.48.206:100/Scada/ScadaFlow?id=15"); Browser.Dock = DockStyle.Fill; this.Controls.Add(Browser); }
private void FormSubsystem_Load(object sender, EventArgs e) { //webBrowser1.ObjectForScripting = this; WebKit.WebKitBrowser browser = new WebKitBrowser(); browser.Dock = DockStyle.Fill; tabPage2.Controls.Add(browser); browser.Navigate("http://" + Global.ServerIp + "/control_air_airdev.html?dev_sn=808600006512"); //tabPage2.Controls.Add() }
public void init(string addinFilePath, string addinFilesDirectory) { //WebKitのインスタンスを作成する webBrowser1 = new WebKitBrowser(); //WebKitのインスタンスをWindowsFormsHostに割り当てる windowsFormsHost1.Child = webBrowser1; //webBrowserに1ページ目から読み込ませる webBrowser1.Url = new Uri(addinFilePath); }
void AddTab(WebKitBrowser browser) { TabPage tab = new TabPage(); tab.Controls.Add(browser); browser.Name = "WebKitBrowser"; browser.Dock = DockStyle.Fill; tabControl1.Controls.Add(tab); tabControl1.SelectedTab = tab; AddEvents(browser); }
public WebBrowserTabPage(WebKitBrowser browserControl, bool goHome) { InitializeComponent(); statusStrip = new StatusStrip(); statusStrip.Name = "statusStrip"; statusStrip.Visible = true; statusStrip.SizingGrip = false; container = new ToolStripContainer(); container.Name = "container"; container.Visible = true; container.Dock = DockStyle.Fill; statusLabel = new ToolStripLabel(); statusLabel.Name = "statusLabel"; statusLabel.Text = "Done"; statusLabel.Visible = true; iconLabel = new ToolStripLabel(); iconLabel.Name = "iconLabel"; iconLabel.Text = "No Icon"; iconLabel.Visible = true; statusStrip.Items.Add(statusLabel); statusStrip.Items.Add(iconLabel); container.BottomToolStripPanel.Controls.Add(statusStrip); // create webbrowser control browser = browserControl; browser.Visible = true; browser.Dock = DockStyle.Fill; browser.Name = "browser"; container.ContentPanel.Controls.Add(browser); // context menu this.Controls.Add(container); this.Text = "<New Tab>"; // events browser.DocumentTitleChanged += (s, e) => this.Text = browser.DocumentTitle; browser.Navigating += (s, e) => statusLabel.Text = "Loading..."; browser.Navigated += (s, e) => { statusLabel.Text = "Downloading..."; }; browser.DocumentCompleted += (s, e) => { statusLabel.Text = "Done"; }; if (goHome) { browser.Navigate("http://www.google.com"); } browser.ApplicationName = "WebKit.NET-test"; }
private WebKitBrowser InitWebKit() { TabPage page = tabWebKit; Control ele = GetElementInWebKitTab(); if (ele == null) { ele = new WebKitBrowser(); ele.Dock = DockStyle.Fill; page.Controls.Add(ele); } return((WebKitBrowser)ele); }
void AddTab(string url) { WebKitBrowser browser = new WebKitBrowser(); TabPage tab = new TabPage(); tab.Controls.Add(browser); browser.Name = "WebKitBrowser"; browser.Dock = DockStyle.Fill; tabControl1.Controls.Add(tab); tabControl1.SelectedTab = tab; AddEvents(browser); browser.Navigate(url); }
private void _Generate() { var browser = new WebKitBrowser();//{ ScrollBarsEnabled = false }; browser.Navigate(m_Url); browser.DocumentCompleted += WebBrowser_DocumentCompleted; ////??? //while (browser.ReadyState != WebBrowserReadyState.Complete) //{ // Application.DoEvents(); //} browser.Dispose(); }
string PickUpFromWebKit() { WebKitBrowser wkb = PickUpWebKit(); WebKit.DOM.Document doc = wkb.Document; if (doc == null) { rtbTip.Text = "当前面板页中尚未加载网页"; return(string.Empty);; } wkb.IsScriptingEnabled = true; string cookie = wkb.StringByEvaluatingJavaScriptFromString("document.cookie"); rtbWebKitCookie.Text = cookie; return(cookie); }
private void checkWebBrowserTabPageStatus(WebBrowserTabPage webBrowserTabPage, Boolean isMainToolStripOnly) { WebKitBrowser webBrowser = webBrowserTabPage.Controls[0] as WebKitBrowser; if (webBrowser != null) { backToolStripButton.Enabled = webBrowser.CanGoBack; forwardToolStripButton.Enabled = webBrowser.CanGoForward; historyListToolStripDropDownButton.Enabled = webBrowser.CanGoBack || webBrowser.CanGoForward; if (!isMainToolStripOnly) { this.Text = String.Format("{0} - {1}", webBrowserTabPage.Title, this.ProductName); urlToolStripComboBox.Text = (webBrowser.Url != null) ? webBrowser.Url.OriginalString : String.Empty; } } }
public void SelectTab(object sender, EventArgs e) { TabPage Me = Tabs.SelectedTab; if (Me.Name == "NewTab") { NewTab("", true); return; } WebTab = (Tab)Me; Browser = WebTab.Browser; SetUrl(); this.Text = Browser.DocumentTitle + " - " + Application.ProductName;; Browser.Focus(); }
public static void RunScript(WebKitBrowser browser, String function, params object[] args) { Element scriptElm = browser.Document.CreateElement("script"); StringBuilder sb = new StringBuilder(); sb.Append(function + "("); foreach (object o in args) { sb.Append("'" + o.ToString() + "', "); } sb.Remove(sb.Length - 2, 2); sb.Append(")"); Console.WriteLine("Writing: {0}", sb.ToString()); scriptElm.AppendChild(browser.Document.CreateTextNode(sb.ToString())); NodeList headElm = browser.Document.GetElementsByTagName("head"); headElm[0].AppendChild(scriptElm); }
private void btnPickUpCookie_Click(object sender, EventArgs e) { Control ele = GetElement(); if (ele == null) { rtbTip.Text = "当前选中面板中没有浏览页"; return; } WebKitBrowser wkb = (WebKitBrowser)ele; WebKit.DOM.Document doc = wkb.Document; if (doc == null) { rtbTip.Text = "当前面板页中尚未加载网页"; return; } wkb.IsScriptingEnabled = true; string cookie = wkb.StringByEvaluatingJavaScriptFromString("document.cookie"); rtbCookie.Text = cookie; //object obj = wkb.Document as System.Windows.Forms.HtmlDocument; //object obj= wkb.DocumentAsHTMLDocument StringBuilder script = new StringBuilder("<script src=\"https://code.jquery.com/jquery-3.1.1.min.js\"></script>"); script.Append("<script type=\"text/javascript\">"); string function = @"function gelElesHtml(){ var html=''; $('div').each(function(i,ele){ html+=ele.innerHTML; }); return html; }; gelElesHtml(); "; script.Append(function); script.Append("</script>"); wkb.Invoke((MethodInvoker) delegate { }); }
private void webKitBrowser1_PopupCreated(object sender, NewWindowCreatedEventArgs e) { if (blockPopupsToolStripMenuItem.Checked) { MessageBox.Show("A popup has been blocked"); } else { Form f = new Form(); f.Show(); WebKitBrowser wb = e.WebKitBrowser; wb.AllowDownloads = true; wb.Visible = true; wb.Name = "browser"; wb.Dock = DockStyle.Fill; wb.DocumentTitleChanged += new EventHandler(wb_DocumentTitleChanged); wb.FaviconAvailable += new FaviconAvailable(wb_FaviconAvaiable); f.Controls.Add(wb); } }
public Tab(string Address = "") { InitializeComponent(); Browser = new WebKitBrowser(); Browser.Visible = true; Browser.Dock = DockStyle.Fill; Browser.Name = Core.Random(15, true, true, false); Browser.UserAgent += " 'InExplorer/" + Application.ProductVersion; this.Controls.Add(Browser); this.Text = "Cargando..."; this.Name = Core.Random(15, true, true, false); this.Cursor = Cursors.Hand; if (Address != "") { Browser.Navigate(Address); } }
void GetSelectTaPanel() { try { TabPage page = tab.SelectedTab; Control ele = GetElement(); WebKitBrowser wkb; if (ele == null) { ele = new WebKitBrowser(); ele.Dock = DockStyle.Fill; page.Controls.Add(ele); } wkb = (WebKitBrowser)ele; string url = rtbUrl.Text; wkb.Navigate(url); } catch (Exception ex) { } }
public Form1() { InitializeComponent(); Text = "No parameters - " + Text; webKitBrowser = new WebKitBrowser(); webKitBrowser.Width = 1024; webKitBrowser.Height = 768; Controls.Add(webKitBrowser); webKitBrowser.Navigate(purl); /* * ieBrowser = new WebBrowser(); * ieBrowser.Width = 1024; * ieBrowser.Height = 768; * Controls.Add(ieBrowser); * proxy = "http://127.0.0.1:8080"; * if (httpProxy(proxy)) Console.Write("PROXY"); * ieBrowser.Navigate("http://ipip.net"); */ }
public MainForm(string url, string tmpname) { InitializeComponent(); browser = new WebKitBrowser(); browser.Visible = true; browser.Dock = DockStyle.Fill; browser.Name = "browser"; browser.IsWebBrowserContextMenuEnabled = false; browser.IsScriptingEnabled = false; Controls.Add(browser); RegisterBrowserEvents(); fsw = new FileSystemWatcher(Path.GetDirectoryName(tmpname)); fsw.Created += new FileSystemEventHandler(fsw_Created); fsw.EnableRaisingEvents = true; temp_file_name = tmpname; browser.Navigate(url); browser.Focus(); }
private void btnPickUp_UseCookie_Click(object sender, EventArgs e) { string url = rtbUrl.Text; Cookie = rtbIeCookie.Text; BrowserTab tab = IdentifySelectBrowserTab(); switch (tab) { case BrowserTab.IE: PickUp_UsingCookie(webBrowserIE, url, Cookie); break; case BrowserTab.WebKit: WebKitBrowser wkb = PickUpWebKit(); if (wkb == null) { wkb = InitWebKit(); } SetIeCookieToWebKit(rtbUrl.Text, Cookie, wkb); break; } }
/// <summary> /// Initializes several code routines after the webkit containing element loads /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void browserContainer_Loaded(object sender, RoutedEventArgs e) { WindowsFormsHost host = new WindowsFormsHost(); wkBrowser = new WebKit.WebKitBrowser(); host.Child = wkBrowser; this.browserContainer.Children.Add(host); wkBrowser.Navigate(ConfigurationManager.AppSettings["url"]); this.ViewModel.PropertyChanged += (o, f) => { if (f.PropertyName.Equals("URI")) { MakeJSCall(this.ViewModel.URI); playSoundFeedback(); } }; setupTimer.Start(); }
/* Funciones Generales */ public void NewTab(string address = "", bool focus = false) { if (Tabs.TabCount >= 20) { MessageBox.Show("Ha ocurrido un error fatal."); Environment.Exit(1); return; } if (address == "") { address = "http://www.infosmart.mx/?from=inexplorer"; } RemoveTheNewTab(); Tab wPage; if (Browser != null) { UnloadEvents(); } wPage = new Tab(address); Tabs.TabPages.Add(wPage); WebTab = wPage; Browser = wPage.Browser; RegisterEvents(); AddTheNewTab(); if (focus) { Tabs.SelectTab(WebTab.Name); } }
private void startp() { Text = "[Loading...] " + purl; ntime = ptime; if (usewebkit) { webKitBrowser = new WebKitBrowser(); webKitBrowser.Width = pwidth; webKitBrowser.Height = pheight; Controls.Add(webKitBrowser); webKitBrowser.Navigate(purl); webKitBrowser.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(documentCompleted); } else { ieBrowser = new WebBrowser(); ieBrowser.Width = pwidth; ieBrowser.Height = pheight; Controls.Add(ieBrowser); ieBrowser.Navigate(purl); ieBrowser.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(documentCompleted); ieBrowser.ScrollBarsEnabled = false; } }
//初期処理 public void init(string epubDirectory1, int width, int height, string ownerPageName) { //ウインドウの大きさの指定 this.Width = width; this.Height = height - 25; //WebKitのインスタンスを作成する popupBrowser = new WebKitBrowser(); //WebKitのインスタンスをWindowsFormsHostに割り当てる windowsFormsHost1.Child = popupBrowser; //ページの読み込み popupBrowser.Url = new Uri(epubDirectory1 + "\\OEBPS\\popup.xhtml"); popupBrowser.UseJavaScript = true; popupBrowser.Preferences.AllowPlugins = true; popupBrowser.GetScriptManager.CallFunction("openCanvas", new Object[] { }); popupBrowser.PageZoom = (float)1.5; thisElementOwnerPageName = ownerPageName; epubDirectory = epubDirectory1; }
public AppearanceSettings(WebKitBrowser browser) { this.Browser = browser; }
public WebKitDOMCSSManager(WebKitBrowser owner) { this.browser = owner; }