browser

Why is there a significant performance increase when using td and tr to wrap thousands of lines of source code in a listing?

六月ゝ 毕业季﹏ 提交于 2020-01-23 12:41:54
问题 I am currently writing a sophisticated syntax highlighter to properly highlight source code listings. In order to test the performance of my statically generated HTML output (not even while dynamically replacing the DOM) I initially used a 3k LoC file which resultend in an 1 MB HTML and noticed unbearable performance degradation on my first implementation. Previously the output was of this form: <pre> <code> <span class="token import">import</span> <span class="token export-all">*</span> <!--

How to set focus to child and opener windows when tabbed

谁说胖子不能爱 提交于 2020-01-23 05:56:54
问题 How do I set focus back to the parent window when in another browser tab? I've tried: window.opener.focus(); to no avail. It only seems to work when the windows are not docked. I need this to work in Chrome, IE9/10, Firefox, and Safari. Internet Explorer also seems to have issues setting focus to a child window. E.g. when using: var windowRef = window.open(url); then later from the same tab: windowRef.focus(); // ok in Chrome, doesn't seem to work in IE... 回答1: What exactly do you want to

How to set focus to child and opener windows when tabbed

旧街凉风 提交于 2020-01-23 05:56:50
问题 How do I set focus back to the parent window when in another browser tab? I've tried: window.opener.focus(); to no avail. It only seems to work when the windows are not docked. I need this to work in Chrome, IE9/10, Firefox, and Safari. Internet Explorer also seems to have issues setting focus to a child window. E.g. when using: var windowRef = window.open(url); then later from the same tab: windowRef.focus(); // ok in Chrome, doesn't seem to work in IE... 回答1: What exactly do you want to

Can I use Python to develop extensions for all major browsers?

╄→гoц情女王★ 提交于 2020-01-23 05:43:06
问题 Can I use Python to develop extensions for all major browsers? If not then what languages will I need to know to develop extensions for: Chrome Firefox Safari IE Opera 回答1: Most extensions are just bundled HTML, CSS, JS and image files, plus some metadata. You'll need to be good at JS, and most importantly, you'll also need to learn about each browser's API. Here are documentation and "getting started" pages for extensions development on different browsers: Chrome Firefox (see also XUL)

Web Push Notification: How to use Web Push PHP Library?

。_饼干妹妹 提交于 2020-01-22 05:50:21
问题 I Want to add Web Notification to my website. I searched on Google and found some tutorials about it. As described in these tutorials I manage to show subscription box to the visitors and I can store their data also. Main.js 'use strict'; const applicationServerPublicKey = 'BBw_opB12mBhg66Dc94m7pOlTTHb5oqFAafbhN-BNeazWk8woAcSeHdgbmQaroCYssUkqFfoHqEJyCKw'; const pushButton = document.querySelector('.js-push-btn'); let isSubscribed = false; let swRegistration = null; function urlB64ToUint8Array

Can I configure my browser to let my web app receive a right-click instead of the browser itself? [duplicate]

*爱你&永不变心* 提交于 2020-01-22 04:14:45
问题 This question already has answers here : React Synthetic Event distinguish Left and Right click events (3 answers) Closed 21 days ago . I want to be able to use a right-click in a single page (react) app. Every time I right click, the browser handles it instead of letting my app handle it. This seems to happen with Chrome and Safari. Is there a way to tell either browser to pass the right-click to the web app? 回答1: onContextMenu Please refer to the official documentation to get a complete

contentEditable on nodes in a XML/compound document?

杀马特。学长 韩版系。学妹 提交于 2020-01-22 02:24:46
问题 I have an XML document that I'm displaying in a web browser, with a stylesheet attached: <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <?xml-stylesheet type="text/css" href="abc.css"?> <myxml xmlns:xhtml="http://www.w3.org/1999/xhtml"> <para>I wish i was editable</para> <xhtml:script type="text/javascript" src="abc.js"/> </myxml> With the xhtml namespace declaration, and xhtml:script tag, I can execute javascript. What I'd like to do is to make arbitrary non-XHTML elements in this

Is it possible to capture a screenshot of the client's desktop from within a web application?

主宰稳场 提交于 2020-01-21 14:37:00
问题 I would like to know if it is possible to capture a screenshot of the client's desktop from within a JavaScript based web application. I want to provide to the users a button within the application that they can use to take a screenshot of their desktop screen (not the page, or elements in the page, the actual OS desktop screen). Does the main browsers (Chrome and Firefox) allow this kind of operation? I'm aware that there may be security concerns, but could I maybe ask permission from the

Is it possible to capture a screenshot of the client's desktop from within a web application?

喜欢而已 提交于 2020-01-21 14:36:14
问题 I would like to know if it is possible to capture a screenshot of the client's desktop from within a JavaScript based web application. I want to provide to the users a button within the application that they can use to take a screenshot of their desktop screen (not the page, or elements in the page, the actual OS desktop screen). Does the main browsers (Chrome and Firefox) allow this kind of operation? I'm aware that there may be security concerns, but could I maybe ask permission from the

Is it possible to capture a screenshot of the client's desktop from within a web application?

佐手、 提交于 2020-01-21 14:36:06
问题 I would like to know if it is possible to capture a screenshot of the client's desktop from within a JavaScript based web application. I want to provide to the users a button within the application that they can use to take a screenshot of their desktop screen (not the page, or elements in the page, the actual OS desktop screen). Does the main browsers (Chrome and Firefox) allow this kind of operation? I'm aware that there may be security concerns, but could I maybe ask permission from the