google-chrome

Uncaught (in promise) DOMException: Failed to execute 'texImage2D' on 'WebGL2RenderingContext': Tainted canvases may not be loaded

泪湿孤枕 提交于 2020-08-27 20:45:24
问题 ''' <html> <head> <meta charset="UTF-8"> <!-- Load TensorFlow.js --> <script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs"></script> <!-- Load Posenet --> <script src="https://cdn.jsdelivr.net/npm/@tensorflow-models/posenet"></script> </head> <body> <img id='cat' src='cat.jpg '/> </body> <!-- Place your code in the script tag below. You can also use an external .js file --> <script> var flipHorizontal = false; var imageElement = document.getElementById('cat'); posenet.load().then

How to get the rendered font in JavaScript?

≯℡__Kan透↙ 提交于 2020-08-27 07:26:27
问题 Google Chrome displays the rendered font in the DevTools. For example, given: font-family: Montserrat, Helvetica, sans-serif; and the Montserrat font is missing/disabled, Chrome tells us that Helvetica is being rendered: Is there a way to get the rendered font in JavaScript? (even if it just works in Chrome) Notes: This solution suggests getComputedStyle(...).fontFamily , but it returns the CSS declaration "Montserrat, Helvetica, sans-serif" , not the actual rendered font. This solution uses

How to get the rendered font in JavaScript?

依然范特西╮ 提交于 2020-08-27 07:26:07
问题 Google Chrome displays the rendered font in the DevTools. For example, given: font-family: Montserrat, Helvetica, sans-serif; and the Montserrat font is missing/disabled, Chrome tells us that Helvetica is being rendered: Is there a way to get the rendered font in JavaScript? (even if it just works in Chrome) Notes: This solution suggests getComputedStyle(...).fontFamily , but it returns the CSS declaration "Montserrat, Helvetica, sans-serif" , not the actual rendered font. This solution uses

Why am I getting weird result using parseInt in node.js? (different result from chrome js console)

谁都会走 提交于 2020-08-26 21:32:41
问题 I just noticed that: //IN CHROME JS CONSOLE parseInt("03010123"); //prints: 3010123 //IN NODE.JS parseInt("03010123"); //prints: 790611 Since both are based on V8, why same operation yielding different results??? 回答1: Undefined behavior occurs when the string being passed to parseInt has a leading 0, and you leave off the radix parameter. An integer that represents the radix of the above mentioned string. Always specify this parameter to eliminate reader confusion and to guarantee predictable

Strange styling through injected stylesheets in Chrome

坚强是说给别人听的谎言 提交于 2020-08-26 19:53:11
问题 We've just purchased a Primeface Theme&Layout Sentinel. However I've noticed a strange styling on tables in Chrome. The Table header and footer has an orange border. My colleagues don't see this and if I change my chrome profile I don't see it either. The original can be seen here: http://www.primefaces.org/sentinel/documentation.xhtml#j_idt38 I've noticed that Chrome is injecting a stylesheet: .ui-widget-header { border: 1px solid rgb(231, 143, 8); border-image-source: initial; border-image

Strange styling through injected stylesheets in Chrome

一曲冷凌霜 提交于 2020-08-26 19:50:48
问题 We've just purchased a Primeface Theme&Layout Sentinel. However I've noticed a strange styling on tables in Chrome. The Table header and footer has an orange border. My colleagues don't see this and if I change my chrome profile I don't see it either. The original can be seen here: http://www.primefaces.org/sentinel/documentation.xhtml#j_idt38 I've noticed that Chrome is injecting a stylesheet: .ui-widget-header { border: 1px solid rgb(231, 143, 8); border-image-source: initial; border-image

JavaScript Code Works Faster when JS Profiling is on? What?

一世执手 提交于 2020-08-26 18:59:50
问题 I'm facing a very strange behaviour with my application - if I start the profiler (must be JS profiler), the code works almost twice as fast. I've reproduced it with a very simple code which can be found on this fiddle: https://jsfiddle.net/zagrwk44/ The thing is that this reproduces only on machines with old graphic cards. I've managed to reproduce it on a machine with AMD Radeon HD 6450 graphic card. On a newer machine this does not reproduce anymore. How come the profiler makes the code

How to get the selected text from an embedded pdf in a web page?

南楼画角 提交于 2020-08-25 04:25:06
问题 Here's an example of a pdf document from which I need to extract the user's selection http://www.ada.gov/hospcombrprt.pdf . If we look in the page source we will see smth like: <html> <body marginwidth="0" marginheight="0" style="background-color: rgb(38,38,38)"> <embed width="100%" height="100%" name="plugin" src="http://www.ada.gov/hospcombrprt.pdf" type="application/pdf"> </body> </html> How can we get a user's selection from this embedded pdf? I found a post about extracting the whole

getting error `This document requires 'TrustedHTML' assignment` in chrome

有些话、适合烂在心里 提交于 2020-08-25 03:48:32
问题 I am working on an app running Angularjs 1.4. This morning the app started crashing wit the below error when I updated my Chrome browser to Version 83.0.4103.61 Seems like it does not accept innerHTML anymore. Edit: I figured out it has something to do with our CSP policies especially require-trusted-types-for 'script'; With the new chrome update, it seems to have become stricter. 回答1: A way to avoid the error: Add a CSP require-trusted-types-for 'script';trusted-types default (source on

How to stop Chrome from autocompleting text areas?

半腔热情 提交于 2020-08-24 08:18:05
问题 I am dealing with a text area in part of a contact form that Chrome wants to autofill with the user's address. As a result many contact requests are submitted by users with their address in the comment field. Besides the obvious potential security issues that could be exploited, my concern is that from a user's standpoint we're providing a contact form without an area to type a message. And from a support standpoint, we're having to ask users to send us another message with their actual