browser

How to detect page zoom level in IE 8?

走远了吗. 提交于 2019-12-23 09:39:29
问题 Sadly I didn't a good enough solution on this generic question. The most upvoted & accepted answer does't seem to work for me on IE 8.0.7601.17514 (latest). Another answer came close to working - but it is always off for me by 20%, probably because I have large fonts defined in Windows. I'm imagine I can't detect this in javascript, so this is not a solid answer as well (even though it might actually work for 95% of IE users ... I might use it as a workaround). Is there a better, solid way to

does image dpi matter to web browsers?

 ̄綄美尐妖づ 提交于 2019-12-23 09:32:33
问题 In the past I had seen occasions where images that weren't 72 dpi wouldn't show in some web browsers, primarily Internet Explorer 7. However, weird thing is, I have tested this lately and it appears that images of 300dpi are showing in IE. Does DPI matter anymore for web? Will photos of some DPIs not display in some web browers? 回答1: No, it doesn't and it never matter. DPI only matters for printing. 来源: https://stackoverflow.com/questions/3803644/does-image-dpi-matter-to-web-browsers

suppress/redirect stderr when calling python webrowser

与世无争的帅哥 提交于 2019-12-23 09:32:18
问题 I have a python program that opens several urls in seperate tabs in a new browser window, however when I run the program from the command line and open the browser using webbrowser.open_new(url) The stderr from firefox prints to bash. Looking at the docs I can't seem to find a way to redirect or suppress them I have resorted to using browserInstance = subprocess.Popen(['firefox'], stdout=log, stderr=log) Where log is a tempfile & then opening the other tabs with webbrowser.open_new. Is there

Are there any adverse side effects to loading html5shiv in every browser?

删除回忆录丶 提交于 2019-12-23 09:31:24
问题 On the html5shiv Google Code page the example usage includes an IE conditional: <!--[if lt IE 9]> <script src="dist/html5shiv.js"></script> <![endif]--> However on the html5shiv github page, the description explains: This script is the defacto way to enable use of HTML5 sectioning elements in legacy Internet Explorer, as well as default HTML5 styling in Internet Explorer 6 - 9, Safari 4.x (and iPhone 3.x ), and Firefox 3.x . An obvious contradiction. So to satisfy my curiosity, for anyone who

Can I force the browser to render out the DOM changes before continuing javascript execution?

微笑、不失礼 提交于 2019-12-23 09:29:37
问题 I am populating a table with about 500 rows, which takes the browser a few seconds to render, while it appears frozen. This is why I want to display a message asking for the user's patience: $.ajax({ url: '{{ search_url }}', success: function (response) { $('#progress').text('Rendering results, please wait...'); clear_table(); populate_table(response); } }); The message isn't displayed - apparently the browser (tested in Chrome 23) buffers all the DOM changes and renders them all in a single

How can i delete the file that has been navigated in a webbrowser control?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-23 09:24:58
问题 How can I delete the file that has been navigated in the webbrowser? Error says "It is being used by another process" preview_wb.Navigate(@"C:\mypdf.pdf"); private void close_btn_Click(object sender, EventArgs e) { preview_wb.Stop(); File.Delete(@"C:\mypdf.pdf"); } 回答1: Usually people suggest this code: webBrowser.Navigate("about:blank"); while (webBrowser.ReadyState != WebBrowserReadyState.Complete) Application.DoEvents(); File.Delete(fileName); I don't like it. I prefer to handle

How to clear the javascript console programmatically?

爷,独闯天下 提交于 2019-12-23 08:53:38
问题 How we can clear the Console in Chrome, Firefox and other browsers. I've tried the following commands, but none is working: Chrome: clear() Firefox: console.clear() Any ideas? 回答1: For every browser it is different so you can write some script so that it will work for different browsers. or you can use this script console.API; if (typeof console._commandLineAPI !== 'undefined') { console.API = console._commandLineAPI; //chrome } else if (typeof console._inspectorCommandLineAPI !== 'undefined'

Navigation and WebBrowser control

帅比萌擦擦* 提交于 2019-12-23 08:47:29
问题 Can i use XPAth expressions to navigate through DOM elements in WebBrowser control? May be attaching javascript code and use document.evaluate function is right way? Can another activeX browser component(firefox,webkit.net) help me to solve my task? 回答1: The Microsoft WebBrowser control is a managed wrapper around Microsoft's COM web browser control, as far as I understand it. So under the hood it is the same rendering and DOM implementation that IE uses, called MSHTML. As that does not

Ctrl+click on links with click handlers

一个人想着一个人 提交于 2019-12-23 08:34:49
问题 I have a link (anchor) that has an href attached to it to navigate to a specific URL say 'www.bla.com'. <a href='http://www.bla.com' /> I also have an click handler attached to the link that performs some actions and then opens an html view in the same window. Everything works perfectly well. However, when the user uses 'ctrl+click' to open the link in a new tab/window, the click handler seems to be taking precedence and opens the html view in the same window. But I want to retain the 'ctrl

Ctrl+click on links with click handlers

落爺英雄遲暮 提交于 2019-12-23 08:34:33
问题 I have a link (anchor) that has an href attached to it to navigate to a specific URL say 'www.bla.com'. <a href='http://www.bla.com' /> I also have an click handler attached to the link that performs some actions and then opens an html view in the same window. Everything works perfectly well. However, when the user uses 'ctrl+click' to open the link in a new tab/window, the click handler seems to be taking precedence and opens the html view in the same window. But I want to retain the 'ctrl