webbrowser-control

Geolocation in WinForms application

我与影子孤独终老i 提交于 2021-02-18 12:58:12
问题 I want to create a WinForms app that can detect location just like a web browser would using the javascript function navigator.geolocation.getCurrentPosition(showPosition); Is there some way to do this in WinForms directly? I thought that I might be able to use the WebBrowser control to do this but I don't believe this supports Geolocation (unless someone knows otherwise?) Apparently the Gecko browser does support gelocation but this is not an option for me because client may have a different

How to bypass Internet Explorer Enhanced Security when using embedded WebBrowser control?

[亡魂溺海] 提交于 2021-02-18 11:47:06
问题 i have a native Windows application that embeds the WebBrowser , i.e. CLSID_WebBrowser 8856F961-340A-11D0-A96B-00C04FD705A2 Shell.Explorer.2 Unfortunately, when running on Windows Servers, the Internet Explorer Enhanced Security mode interferes with the WebBrowser control, causing it to not render at all: In this case, the UI of the software is driven as a WebBrowser control - making the software unusable. i could disable Internet Explorer Enhanced Security mode, but that is not practical.

event handler for WebBrowser control onpropertychange events - sender and e objects are null

旧城冷巷雨未停 提交于 2021-02-16 20:26:11
问题 In C#, I am running the WebBrowser (WB) control in a server-side thread and want to monitor (listen) for "onpropertychange" events. I can successfully attach a .NET delegate signature method that is executed when a property changes, but the sender and e objects are both null in every call to qEventHndlr, therefore, I don't know which property changed to fire the event. el is an HTMLElement that is iterated in a foreach loop to attach the eventhandler to each element to monitor (listen). el

event handler for WebBrowser control onpropertychange events - sender and e objects are null

故事扮演 提交于 2021-02-16 20:26:06
问题 In C#, I am running the WebBrowser (WB) control in a server-side thread and want to monitor (listen) for "onpropertychange" events. I can successfully attach a .NET delegate signature method that is executed when a property changes, but the sender and e objects are both null in every call to qEventHndlr, therefore, I don't know which property changed to fire the event. el is an HTMLElement that is iterated in a foreach loop to attach the eventhandler to each element to monitor (listen). el

How can C# WebBrowser reduce the memory occupying/How to solve WebBrowser's memory leak?

纵饮孤独 提交于 2021-02-11 17:00:23
问题 I'm using WebBrowser to write a program (let's call it < tinyWb >) to do some automatic web form filling jobs, etc., just for fun. < tinyWb > mainly does the following jobs: open a tabPage, navagate to a URL, do some business, and then close the tab. There are about 25 URLs total that need to be navigated to, but I found that the memory that the < tinyWb > program is occupying is growing continuously, and after about 10 hours it will require about 120m physical memory and about 240m virtual

how to handle the onclick attribute c# webbrowser?

痴心易碎 提交于 2021-02-11 12:28:57
问题 HtmlElementCollection elementButton = webBrowser1.Document.GetElementsByTagName("a"); foreach (HtmlElement elementyButton in elementButton) { if (elementyButton.GetAttribute("onclick") == "ExecuteBid('46097');") { elementyButton.InvokeMember("click"); } } I intend to program an automatic click, but the click can only happen in a specific location, the only attribute different from the others is onclick. I can use the class, for example, but the site has several buttons with the same class, if

how to handle the onclick attribute c# webbrowser?

╄→гoц情女王★ 提交于 2021-02-11 12:25:43
问题 HtmlElementCollection elementButton = webBrowser1.Document.GetElementsByTagName("a"); foreach (HtmlElement elementyButton in elementButton) { if (elementyButton.GetAttribute("onclick") == "ExecuteBid('46097');") { elementyButton.InvokeMember("click"); } } I intend to program an automatic click, but the click can only happen in a specific location, the only attribute different from the others is onclick. I can use the class, for example, but the site has several buttons with the same class, if

Opening TWebBrowser link in default browser

给你一囗甜甜゛ 提交于 2021-02-07 14:33:22
问题 My application displays a small banner loaded from the web in a TWebBrowser control. This banner is actually a HTML page including an image; when the users click the image it takes them to the promotional campaign we're currently running. The bad thing here is that when clicking the link in TWebBrowser, the campaign page is opened in Internet Explorer, not in their default browser. I know this happens because TWebBrowser is a IE-based control, but is there a way to open the link in users'

System.Windows.Forms.WebBrowser wait until page has been fully loaded

空扰寡人 提交于 2021-02-05 08:13:28
问题 I have been trying a lot of different solutions with wait and async . Nothing seems to work. I was not able to find solution that actually fully waits until page has been fully loaded. All codes are waiting some time but not until page has been loaded and I am getting an error on next process. How I can set for example code into wait mode until Document.GetElementById("quickFind_text_0") element has been found on page? Here is my code: private void button7_Click(object sender, EventArgs e) {

How to show address bar in WebBrowser control

只谈情不闲聊 提交于 2021-02-05 04:44:20
问题 How to show address bar in WebBrowser control in a Windows Form? 回答1: I could be mistaken but I don't believe the WebBrowserControl includes the address bar, toolbar, etc. I believe you'll have to create your own address bar. You could use the Navigated or Navigating events to determine when the URL is changing and update the text box. private void button1_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(textBox1.Text)) { webBrowser1.Navigate(textBox1.Text); } } private void