browser

How to get the video card driver name using javascript browser side?

ぐ巨炮叔叔 提交于 2021-01-03 04:31:30
问题 I want to get a string like: Intel Open Source Technology Center Mesa DRI Intel(R) HD Graphics 520 (Skylake GT2) Only using javascript on the browser. I know that a library from augur.io can find that value but I need a open source solution or to know what js method can be used. 回答1: You can use WebGL's WEBGL_debug_renderer_info extension. Though (a) the user might not have WebGL and (b) the extension might not be available depending on the browser. function getVideoCardInfo() { const gl =

How to get the video card driver name using javascript browser side?

点点圈 提交于 2021-01-03 04:31:25
问题 I want to get a string like: Intel Open Source Technology Center Mesa DRI Intel(R) HD Graphics 520 (Skylake GT2) Only using javascript on the browser. I know that a library from augur.io can find that value but I need a open source solution or to know what js method can be used. 回答1: You can use WebGL's WEBGL_debug_renderer_info extension. Though (a) the user might not have WebGL and (b) the extension might not be available depending on the browser. function getVideoCardInfo() { const gl =

Multi browsers vs multi tabs in Puppeteer

萝らか妹 提交于 2021-01-01 04:56:06
问题 I have 100 web pages that I have to test for runtime errors. I found the Puppeteer plugin that can do that "no sweat", but I ran into one dilemma: have one launched browser with multiple tabs or new browser for each link. What is the best approach in this case? In case of multiple tabs, I heard, there is a chance that css animation and something else (can't remember now) would not work when tab is not in focus. Multiple browser, obviously, causes the higher CPU load (no?) 回答1: These are the

How does `#:~:text=` in URL works to highlight text?

白昼怎懂夜的黑 提交于 2020-12-30 01:33:45
问题 TL;DR How/why are some browsers able to search and highlight text in the HTML body which is followed by #:~:text= in the URL? Explanation One day I was searching for something on Google, which lead me to Quora's result. I observed that 2 sentences were highlighted in yellow, which were part of URL after the aforementioned parameter. I thought this would be Quora's feature for SEO or something, however, also found this on Linkedin, and Medium, and so on. I'd like to know: What is this

Is there a client-side way to detect X-Frame-Options?

独自空忆成欢 提交于 2020-12-24 06:37:41
问题 Is there any good way to detect when a page isn't going to display in a frame because of the X-Frame-Options header? I know I can request the page serverside and look for the header, but I was curious if the browser has any mechanism for catching this error. 回答1: OK, this one is old but still relevant. Fact: When an iframe loads a url which is blocked by a X-Frame-Options the loading time is very short. Hack: So if the onload occurs immediately I know it's probably a X-Frame-Options issue.

Is there a client-side way to detect X-Frame-Options?

江枫思渺然 提交于 2020-12-24 06:37:39
问题 Is there any good way to detect when a page isn't going to display in a frame because of the X-Frame-Options header? I know I can request the page serverside and look for the header, but I was curious if the browser has any mechanism for catching this error. 回答1: OK, this one is old but still relevant. Fact: When an iframe loads a url which is blocked by a X-Frame-Options the loading time is very short. Hack: So if the onload occurs immediately I know it's probably a X-Frame-Options issue.

Is it possible to add a request header to a CORS preflight request?

我的梦境 提交于 2020-12-12 10:34:05
问题 I have a website that accesses an API from an external server (not the server that serves the website) via a plain XmlHttpRequest (see below). That API requires an API key for accessing the service to be added as request header. However, as these are CORS requests the browser first does a preflight request to check if that server supports CORS. Now, it seems that the server also wants to see the API key in these preflight requests that are done by the browser. Is it possible to pass the API

Why is script-src-elem not using values from script-src as a fallback?

末鹿安然 提交于 2020-12-12 04:53:30
问题 When implementing csp-header, I have specified my policy as: default-src 'self'; script-src www.gstatic.com; Since I have not declared script-src-elem directive in my csp policy, as stated in this mdn documentation, I was expecting policy defined for script-src to be used for script-src-elem directive as well. However, I see violation being reported as "viloated-directive":"script-src-elem" "blocked-uri":"https://www.gstatic.com/blah/blah" . Any idea why this behavior is happening? 回答1: After

Drag and drop image convert to Base64

☆樱花仙子☆ 提交于 2020-12-11 09:01:26
问题 I require the following functionality in my website. Everything has to be done on the client (javascript or any javascript library). I have an image in my local machine, drag and drop it in the browser. Without any request to the server, the javascript has to convert this image as base64. I have a code for converting the image to base64 on the client side, but this one requires HTTP URL. What I need is, the image needs to be uploaded from local. function toDataURL(url, callback) { var xhr =

Drag and drop image convert to Base64

一世执手 提交于 2020-12-11 09:01:01
问题 I require the following functionality in my website. Everything has to be done on the client (javascript or any javascript library). I have an image in my local machine, drag and drop it in the browser. Without any request to the server, the javascript has to convert this image as base64. I have a code for converting the image to base64 on the client side, but this one requires HTTP URL. What I need is, the image needs to be uploaded from local. function toDataURL(url, callback) { var xhr =