browser

How to detect browser close at server side in asp.net?

℡╲_俬逩灬. 提交于 2020-01-21 11:06:29
问题 I wanted to know when the browser is closed at server side in asp.net 2.0. How to detect in code behind? 回答1: client side script: < body onbeforeunload="window.open('http://www.website.com/browserclosed.aspx','mywindow','width=1,height=1');"> server side script (browserclosed.aspx): // page_load int userId = Convert.ToInt32(request.session("userId")); ReportBrowserClosed(userId); // Do what you want in ReportBrowserclosed() method 回答2: Short answer: you can't do that directly since http is

How to intercept HTTP OPTIONS calls made by the browser

我们两清 提交于 2020-01-21 10:17:04
问题 I have a use case where I'd like to intercept and log HTTP OPTIONS calls. I understand these are being done by the browser as part of CORS I've tried monkeypatching XMLHttpRequest, and also a service-worker where I'd intercept via the "fetch" event. However I am only ever able to capture non OPTIONS calls (GET, PUT, POST) How can I intercept the OPTIONS calls? I clearly see them being done in the network tab 回答1: CORS preflight requests are hard-coded into browsers as a browser security

PHP Browser Detection and Redirection

时间秒杀一切 提交于 2020-01-21 09:06:29
问题 All, My application supports IE7+, MOZILLA and other modern browsers. Anybody know of a very good browser detection and redirection PHP class? I came across this, but I am not sure if anybody used this: http://chrisschuld.com/projects/browser-php-detecting-a-users-browser-from-php/#typicalusage Thanks 回答1: All you need is get_browser() and a recent browscap.ini that maps the user-agent string to a browser/version and its capabilities. You can get a usually very up-to-date browscap.ini version

Why can I not group browser-specific CSS-selectors for different browsers?

随声附和 提交于 2020-01-21 07:10:12
问题 I just tried to write the following rule to style the input placeholder for browsers that support it: #main input::-webkit-input-placeholder, #main input:-moz-placeholder { color: #888; font-style: italic; } The problem is that the rule isn't applied. However, if I break it up like this instead it works just fine: #main input::-webkit-input-placeholder { color: #888; font-style: italic; } #main input:-moz-placeholder { color: #888; font-style: italic; } Why can I not group browser-specific

Detect if browser has smooth scrolling feature already

Deadly 提交于 2020-01-21 06:44:27
问题 I have added smooth scrolling to a site of mine using this piece of JavaScript when clicking on hash links. $('a[href*=#]') .click(onAnchorClick); function onAnchorClick(event) { return ! scrollTo(this.hash); } function scrollTo(target) { var e = $(target); var y = e.exists() ? e.offset().top : 0; if(y == 0 && target != '#top') return false; if(Math.max($('html').scrollTop(), $('body').scrollTop()) != y) $('html,body') .animate({scrollTop: y}, 500, function() { location.hash = target; } );

Open Explorer window from Website

我与影子孤独终老i 提交于 2020-01-21 05:25:07
问题 My company has a shared network folder for projects. This folder contains a sub-folder for each of our clients. Each sub-folder contains all the information for the projects done for those clients. Makes sense, yea? OK. I have been given a task: When in our company's MS CRM and viewing a client account, allow the user to click a button that will open explorer to the project folder for that account. Sounds easy. Did a bit of hunting online. This looks nice: http://blogs.msdn.com/crm/archive

Python - Selenium - How to use Browser Shortcuts

被刻印的时光 ゝ 提交于 2020-01-20 06:00:24
问题 Once a browser page is loaded I'm looking to use the CRTL+P shortcut in Goggle Chrome to enter the print page and then simply press return to print the page. import time from selenium import webdriver # Initialise the webdriver chromeOps=webdriver.ChromeOptions() chromeOps._binary_location = "C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe" chromeOps._arguments = ["--enable-internal-flash"] browser = webdriver.Chrome("C:\\Program Files\\Google\\Chrome\\Application\\chromedriver.exe

Accessing DOM from WebBrowser

我怕爱的太早我们不能终老 提交于 2020-01-20 04:24:25
问题 I am trying to implement a browser-like little application that would allow me to modify the viewed web-sites appearance (e.g. make the font for links bigger). It is designed for Microsoft Surface, to be used on a huge touchscreen. It uses WPF for the UI. I am intending to use a WebBrowser control for this task. However there are two classes called WebBrowser in the docs. One of them is in System.Windows.Forms , the other in System.Windows.Controls . The first one gives access to DOM model,

Searching Microsoft Edge Chromium DLL for C# WPF Project [closed]

十年热恋 提交于 2020-01-17 21:24:29
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 21 hours ago . Now there is Microsoft Edge Chromium. The Project uses cefcharp at the moment. But I want to use Chromium from Edge. I am working on a C# Project with WPF and I am using a Chromium DLL. In my WPF Project I have give the user the oportunity to use a WebBrowser. And I want to embedd everyting inside my solution.

How to prevent users to go in debug mode with their browser

删除回忆录丶 提交于 2020-01-17 15:22:22
问题 This might sound silly, but as a developer, I'm using the debugger in Chrome every day to test my web applications, but although these tools are valuable for us developers, it might also be used against us by users how wants to mess with our systems. You probably know that it is fairly easy, using the debugger, to re-enable a button that was previously set to disabled, or change the value of hidden tags or variables. It would then be easy to post a form that is not suppose to be sent, with