webbrowser-control

How to pass a parameter to a local html page in WP7 / WP8?

半腔热情 提交于 2019-12-30 10:37:21
问题 Does anyone know how to pass a url parameter to a local page in the Web Browser Control? When you navigate to the page alone "/Html/MyPage.html" all is well but as soon as you add a parameter "/Html/MyPage.html?Message=Hello" I get an error page stating that we could not navigate to the page. Any ideas? 回答1: As another workaround you can pass your arguments as location hash parameter (if it is not used) browser.Navigate(new Uri("www/index.html#p=123&p2=567", UriKind.Relative)); and then in

InvokeRequired of Form == false and InvokeRequired of contained control == true

核能气质少年 提交于 2019-12-30 08:32:02
问题 how is it possible? I have windows Form control, derived from System.Windows.Forms.Form with WebBrowser control contained in this form. Webbrowser object instance is created in constructor of form (in InitializeComponent() method). Then in background thread I manipulate with content of WebBrowser, and I found that in some cases Form.InvokeRequired == false, while WebBrowser.InvokeRequired == true. How can it be? 回答1: Form.InvokeRequired returns false before the form is shown. I did a simple

DocumentCompleted firing multiple times - accepted StackOverflow answer not working

耗尽温柔 提交于 2019-12-30 06:36:13
问题 I test if my WebBrowser is completed with: webBrowser2.DocumentCompleted += (s, e) => { // Do stuff } The webpage I am accessing as tons of JS files and iframes and stuff, so I use the below function to make sure it's the actual page that's completed loading. webBrowser2.DocumentCompleted += (s, e) => { if (e.Url.AbsolutePath != (s as WebBrowser).Url.AbsolutePath) { return; } // Do stuff } However, it still doesn't appear to be working. Am I doing something wrong or is this syntactically

Excel VBA create an embedded WebBrowser and use it

末鹿安然 提交于 2019-12-30 04:48:06
问题 Hi I'm trying to dynamically create a web browser inside a spreadsheet and then use it but the WebBrowser functions don’t seem to work Here is how I create the WebBrowser Set myWebBrowser = Sheets("test").OLEObjects.Add(ClassType:="Shell.Explorer.2", Link:=False, DisplayAsIcon:=False, left:=147, top:=60.75, width:=141, height:=96) This will work myWebBrowser.top = 10 But this will give me an error myWebBrowser.Navigate ("about:blank") Any ideas on what should I do thank you UPDATE: This will

What UserAgent is reported by the WebBrowser control?

穿精又带淫゛_ 提交于 2019-12-30 01:29:13
问题 Just wondering what browser type the VB.NET reads as when it visits a webpage. For instance on my website it shows a break down of all the different browsers that accessed my site. 回答1: You don't provide much context to your question, but I assume that you're talking about the User Agent string that's sent when you use the WebBrowser control built into the .NET Framework. Because that control just uses Internet Explorer to render the page, you'll see a User Agent string very similar to what

WebBrowser Madness

旧城冷巷雨未停 提交于 2019-12-29 09:08:10
问题 Edit: The original question was a long one with many wild guesses. I have cut it back to the remaining mysteries.. I've been struggling and puzzling all day now and guess I ought to present my problem to the community. It originated from the post called Screenshot method generates black images. The original poster wants to continuously take screenshots of his program, which includes a WebBrowser, every n seconds even when the user is logged off . When the user is logged out he has no screen

C# WebBrowser control: window.external access sub object

自作多情 提交于 2019-12-29 08:00:07
问题 when assigning an object to the ObjectForScripting property of a WebBrowser control the methods of this object can be called by JavaScript by using windows.external.[method_name] . This works without problems. But how I need to design this C# object when I have a JavaScript function like this (accessing a sub object): window.external.app.testfunction(); I tested it with following C# object assigned to the ObjectForScripting property: [ComVisible(true)] public class TestObject { public App app

Disable javascript in WinForms WebBrowser control?

血红的双手。 提交于 2019-12-29 07:36:14
问题 How could I disable javascript entirely on WebBrowser in WinForms? 回答1: You can't. Client apps cannot disable JavaScript in the browser. 回答2: With this you can disable warning from javascript webBrowser.ScriptErrorsSuppressed = true; 来源: https://stackoverflow.com/questions/10623697/disable-javascript-in-winforms-webbrowser-control

WatiN and .net winforms WebBrowser control - is DialogWatcher possible?

老子叫甜甜 提交于 2019-12-29 05:35:10
问题 Our target is: Watin-enabled browser testing embedded in a .net winform. Currently, we are using a .net WebBrowser control to embed browser behavior in a winform. We are attaching WatiN to the WebBroswer control on the form with code like this ( thanks prostynick ): var thread = new Thread(() => { Settings.AutoStartDialogWatcher = false; var ie = new IE(webBrowser1.ActiveXInstance); ie.GoTo("http://www.google.com"); }); thread.SetApartmentState(ApartmentState.STA); thread.Start(); The problem

How to select a class by GetElementByClass and click on it programmatically

╄→гoц情女王★ 提交于 2019-12-28 23:14:43
问题 I have been trying to use this code to read the element by class in html/ajax knowing GetElementByClass is not a option in webBrowser.Document. I can't seem to get a return value then invoke the member. Is there a work around for this? References: Getting HTMLElements by Class Name Example: <span class="example">(<a href="http://www.test.com/folder/remote/api?=test" onclick=" return do_ajax('popup_fodder', 'remote/api?=test', 1, 1, 0, 0); return false; " class="example">test</a>)</span>