webbrowser-control

getting the scroll value from a WebBrowser Control C#

混江龙づ霸主 提交于 2019-12-04 11:41:38
I am trying to get the Y scroll index for a web page in the WebBrowser control but I can't access the values for the built in Scroll bar. Any Ideas? For IE in standards mode (with a doctype, as you say) scrollTop is a property of the <html> element, not the <body> : HtmlDocument htmlDoc = this.webBrowser1.Document; int scrollTop = htmlDoc.GetElementsByTagName("HTML")[0].ScrollTop; (A nicer way to get to the <html> element would be good, if anyone knows of one.) are you trying to target an HTML element to bring it into view? If that is what you are after you can do this... htmlDoc

Implementing Drag and Drop Functionality WebBrowser Control Winforms C#

回眸只為那壹抹淺笑 提交于 2019-12-04 11:33:21
I need to capture drag and Drop Events of WebBrowser Control in WinForm C#. Is there any way ? My Workarond: use a boolean member variable to detect if you call navigate from inside code or navigating is called from ouside code. Implement the "Navigating" (BeforeNavigating) event and check if it was a call from outside. Example: call navigate from inside: private void NavigateLocal(string htmlFileName) { this.localNavigate = true; this.webBrowser.Navigate(htmlFileName); } event method: private void WebBrowser_Navigating(object sender, WebBrowserNavigatingEventArgs e) { if (this.localNavigate)/

How can I add an extra http header using IHTTPNegotiate?

陌路散爱 提交于 2019-12-04 11:26:51
How can I add an extra header to the request using IHTTPNegotiate? I added the interface but functions BeginningTransaction & OnResponse never get called. TNameSpaceHandler = class(TComObject, IInternetProtocol, IHttpNegotiate) ... function BeginningTransaction(szURL, szHeaders: LPCWSTR; dwReserved: DWORD; out szAdditionalHeaders: LPWSTR): HResult; stdcall; function OnResponse(dwResponseCode: DWORD; szResponseHeaders, szRequestHeaders: LPCWSTR; out szAdditionalRequestHeaders: LPWSTR): HResult; stdcall; ... end; I'm silently assuming you're intercepting traffic by both implementing

Caching and the WebBrowser control in .Net

心已入冬 提交于 2019-12-04 11:03:31
问题 I'm using the WebBrowser control in .Net to execute some 3rd party affiliate marketing conversions. I have a queue table in a database with all the scripts/images to execute. I loop through all these in a WinForms app with the WebBrowser control. After I've executed a script/image I Dispose the WebBrowser control, set it to null, and renews it with a new WebBrowser control instance. Consider this URL: http://renderserver/RenderScript.aspx?id=1 RenderScript.aspx displays an Image with a URL of

Chrome/ Firefox Alternative to TWebBrowser Control

江枫思渺然 提交于 2019-12-04 10:36:52
问题 I have a Delphi app that shows a group of webpages in a TWebBrowser control. Its a kiosk type app so a user touches a button on the side and it shows a particular webpage in a tab. I am having some problems with certain sites and getting IE javscript errors. I would like to know if there is a way I can embed a chrome or firefox browser in a tab or on a form from Delphi? This question seems to answer the issue I had with getting javascript errors. 回答1: I should have googled first. Found this

WPF Web Browser Control and DPI Scaling

三世轮回 提交于 2019-12-04 10:12:04
问题 I'm working with a WPF application that uses the Web Browser control and I'm having issues with High DPI scaling. It looks like the Web Browser control is not properly respecting the DPI settings of the system, while the rest of the WPF application is properly scaling the UI. This means that on higher scale levels the WPF interface gets larger while the Web browser content stays on the original, now smaller looking size. Here's an example of screen captures from a WPF app that uses two Web

Delete cookies in webBrowser without restart

可紊 提交于 2019-12-04 10:09:41
Can you say how I can delete all cookies in private System.Windows.Forms.WebBrowser webBrowser1 . I used [DllImport("wininet.dll", SetLastError = true)] private static extern bool InternetSetOption(IntPtr hInternet, int dwOption, IntPtr lpBuffer, int lpdwBufferLength); I want do this with button click. private void button1_Click(object sender, EventArgs e) { InternetSetOption(IntPtr.Zero, INTERNET_OPTION_END_BROWSER_SESSION, IntPtr.Zero, 0); } But it doesn't work. And I know about webBrowser1.Navigate("javascript:void((function(){var a,b,c,e,f;f=0;a=document.cookie.split('; ');for(e=0;e<a

WebBrowser component not showing CSS 3

ⅰ亾dé卋堺 提交于 2019-12-04 09:27:02
问题 I am building a piece of software that requires a WebBrowser component. Unfortunately it won't show my page correctly. My content uses this CSS style: .content_mid{ background-image:url(http://img.awesome-o.net/Content_Mid.png); background-size: 100% 100%; vertical-align:text-top; padding-left: 40px; padding-right:20px; min-height:400px; } Since I already found out the WebBrowser component uses the installed version of interwebs explorer, I checked the html on Internet Explorer, and it shows

Is there an event that fires when DOM is modified in MSHTML IE8?

无人久伴 提交于 2019-12-04 09:11:20
Trying to detect if new elements are added or removed from the DOM in MSHTML. Is there such event that will fire? http://msdn.microsoft.com/en-us/library/aa741877(v=VS.85).aspx In IE9 there is IDOMMutationEvent::initMutationEvent http://msdn.microsoft.com/en-us/library/ff975905(v=vs.85).aspx Yes, it is possible now in IE8, though it is not part of the MSHTML event structure, but Accessibility. Trigger (EVENT_OBJECT_REORDER) is new in IE8 - See http://blogs.msdn.com/b/ie/archive/2008/12/10/new-accessibility-features-in-ie8.aspx?PageIndex=7 We use it with out BHO, but you could equally hook

What is a good alternative to the WPF WebBrowser Control?

江枫思渺然 提交于 2019-12-04 09:00:56
I have an MDI WPF app that I need to add web content to. At first, great it looks like I have 2 options built into the framework the Frame control and the WebBrowser control. Given that this is an MDI app it doesn't take long to discover that neither of these will work. The WPF WebBrowser control wraps up the IE WebBrowser ActiveX Control which uses the Win32 graphics pipeline. The " Airspace " issue pretty much sums this up as "Sorry, the layouts will not play nice together". Yes, I have thought about taking snapshots of the web content rendering these and mapping the mouse and keyboard