browser

Override IE privacy settings using IInternetSecurityManager in Webbrowser control

梦想的初衷 提交于 2019-12-19 04:51:09
问题 I need to create a custom security manager for a hosted WebBrowser control in my C# application. The hosted WebBrowser control should be independent from IE security and privacy settings. Problem: If IE privacy settings are set to "High", the websites that depend on cookies don't function properly in hosted WebBrowser control (sites work fine if the privacy setting is set to "Medium"). The winform that hosts the WebBrowser control provides below implementation for GetSecurityId, MapUrlToZone

WebBrowser - empty DocumentText

萝らか妹 提交于 2019-12-19 04:11:45
问题 I'm trying to use WebBrowser class, but of course it doesn't work. My code: WebBrowser browser = new WebBrowser(); browser.Navigate("http://www.google.com"); while(browser.DocumentText == "") { continue; } string html = browser.DocumentText; browser.DocumentText is always "" . Why? 回答1: The WebBrowser isn't going to do it's job until the current thread finishes it's work, if you changed it to be something like this: WebBrowser browser = new WebBrowser(); browser.Navigate("http://www.google

Javascript: Read out session id from cookie

て烟熏妆下的殇ゞ 提交于 2019-12-19 04:08:42
问题 for websockets I have to expose my sessionid from the cookie. I have searched a bit and found that I should be able to access cookies by: console.log(document.cookie); unfortunatly this doesn't work or better document.cookie contains an empty string even chrome itself shows me the cookie also authentication works. Can it be that chrome hides the cookie for javascript? 回答1: That can happen if the server is configured to send the session cookie with the HttpOnly flag. This way the cookie

is there a way of detecting whether a window resize event was caused by Android's popup keyboard?

自古美人都是妖i 提交于 2019-12-19 04:01:12
问题 I'm writing a webpage, which will fully support mobile browsers. The page currently uses KnockoutJS to dynamically recalculate component sizes (and hide some components) based on the screen (or container) size. I have a problem with the android browser: When you click on a text field, the pop up keyboard causes a screen resize, which causes KnockoutJS to (correctly) re-render the display. This momentarily causes the text field to lose focus, which pop-up keyboard to disappear. If only I could

is there a way of detecting whether a window resize event was caused by Android's popup keyboard?

℡╲_俬逩灬. 提交于 2019-12-19 04:00:56
问题 I'm writing a webpage, which will fully support mobile browsers. The page currently uses KnockoutJS to dynamically recalculate component sizes (and hide some components) based on the screen (or container) size. I have a problem with the android browser: When you click on a text field, the pop up keyboard causes a screen resize, which causes KnockoutJS to (correctly) re-render the display. This momentarily causes the text field to lose focus, which pop-up keyboard to disappear. If only I could

can I programmatically examine and modify Javascript event handlers on html elements?

一笑奈何 提交于 2019-12-19 03:55:43
问题 I am doing browser automation using C#, and I would like to modify or possibly just eliminate event handlers on some of the html elements in webpages that I am looking at. E.g., suppose there is a button there which might (or might not) have an attached onClick event. How do I go about: - finding out if there are any event handlers attached to onClick for it? - removing them? 回答1: Replacing element with its own clone should effectively discard all of its event listeners (well, technically

Can I detect Tor Browser inside the browser itself, via Javascript I suppose?

淺唱寂寞╮ 提交于 2019-12-19 03:55:10
问题 I'd like to disable some features of a web app I'm building, if the browser is Tor Browser. Can I inside the browser itself (client side, not server side) find out if the browser is Tor Browser? I would prefer a solution that didn't issue any HTTP requests to match the browser's IP against Tor exit nodes. Background: In my case, Tor Browser pops up a dialog that asks the user "Should Tor Browser allow this website to extract HTML5 canvas image data?" , because, says Tor Browser, canvas image

Best Way For Back Button To Leave Form Data

你。 提交于 2019-12-19 03:46:32
问题 I'm creating a web page based on user input from a form. After the user sees the generated page I want to allow them to press the back button and make changes to the form. I would like to display the form as they had filled it out previously. What is the best way to get this behavior (with cross browser support)? 回答1: After the user sees the generated page I want to allow them to press the back button and make changes to the form. I would like to display the form as they had filled it out

Preventing webform resubmission on browser refresh without losing viewstate

血红的双手。 提交于 2019-12-19 03:44:07
问题 Duplicate: How can I prevent database being written to again when the browser does a reload/back? Is there a nice elegant way to stop an .aspx page from resubmitting form data if the user requests a refresh from their browser? Ideally without losing the viewstate. EDIT: The most elegant solution for me turned out to be wrapping the relevant controls in an asp.net ajax UpdatePanel. Ta everyone. 回答1: There is no elegant way, but there are options. As stated in one of the other answers you can

How do I launch a URL from my application on Android?

余生长醉 提交于 2019-12-19 03:37:16
问题 How can I code my Android application to start the web browser to display a given URL? (I'd rather not embed a web browser component into my app, but rather want to start the Android web browser to show the URL.) Thanks! 回答1: Just use an Intent with the correct action and data: Intent intent = new Intent(Intent.ACTION_VIEW); intent.setData(Uri.parse("http://www.stackoverflow.com")); startActivity(intent); 回答2: In case if you have the website displayed on your view and you want it to make it