user-agent

How to detect iOS 13 on JavaScript?

谁都会走 提交于 2020-04-15 21:09:29
问题 I use this function to detect iOS export function isiOS() { return navigator.userAgent.match(/ipad|iphone/i); } is there any way to make it detected iOS13+? thanks Why do I need it? usually, iOS safari can't download files therefore to make image downloadable I should render it as <img src={qrImage} alt="creating qr-key..." /> however on Android/PC and pretty much everywhere else it's possible to do it directly via <a href={qrImage} download="filename.png"> <img src={qrImage} alt="qr code" />

How to detect iOS 13 on JavaScript?

我的未来我决定 提交于 2020-04-15 21:08:50
问题 I use this function to detect iOS export function isiOS() { return navigator.userAgent.match(/ipad|iphone/i); } is there any way to make it detected iOS13+? thanks Why do I need it? usually, iOS safari can't download files therefore to make image downloadable I should render it as <img src={qrImage} alt="creating qr-key..." /> however on Android/PC and pretty much everywhere else it's possible to do it directly via <a href={qrImage} download="filename.png"> <img src={qrImage} alt="qr code" />

Change the default USER-AGENT and REFERRER value in wget

这一生的挚爱 提交于 2020-03-23 05:40:19
问题 When using wget on the console, I usually want to download the version, my Firefox would get, for ex. wget --header="Accept: text/html" --user-agent="Mozilla/5.0 ..." --referrer connect.wso2.com http://dist.wso2.org/products/carbon/4.2.0/wso2carbon-4.2.0.zip How can I change the default behaviour of wget , so just using wget would use the actual useragent and header my current Firefox is using? (Also adding the base-URL of the downloaded site as referer would be nice) 回答1: Create an alias

Change the default USER-AGENT and REFERRER value in wget

牧云@^-^@ 提交于 2020-03-23 05:35:47
问题 When using wget on the console, I usually want to download the version, my Firefox would get, for ex. wget --header="Accept: text/html" --user-agent="Mozilla/5.0 ..." --referrer connect.wso2.com http://dist.wso2.org/products/carbon/4.2.0/wso2carbon-4.2.0.zip How can I change the default behaviour of wget , so just using wget would use the actual useragent and header my current Firefox is using? (Also adding the base-URL of the downloaded site as referer would be nice) 回答1: Create an alias

Change the default USER-AGENT and REFERRER value in wget

若如初见. 提交于 2020-03-23 05:34:10
问题 When using wget on the console, I usually want to download the version, my Firefox would get, for ex. wget --header="Accept: text/html" --user-agent="Mozilla/5.0 ..." --referrer connect.wso2.com http://dist.wso2.org/products/carbon/4.2.0/wso2carbon-4.2.0.zip How can I change the default behaviour of wget , so just using wget would use the actual useragent and header my current Firefox is using? (Also adding the base-URL of the downloaded site as referer would be nice) 回答1: Create an alias

通过userAgent判断手机浏览器类型

拜拜、爱过 提交于 2020-03-01 08:25:57
我们可以通过userAgent来判断,比如检测某些关键字,例如:AppleWebKit*****Mobile或AppleWebKit,需要注意的 是有些浏览器的userAgent中并不包含AppleWebKit关键字,可能会是Linux,UCBrowser等等。 下面是Javascript代码 : <script type="text/javascript"> /* * 智能机浏览器版本信息: */ var browser={ versions:function(){ var u = navigator.userAgent, app = navigator.appVersion; return {//移动终端浏览器版本信息 trident: u.indexOf('Trident') > -1, //IE内核 presto: u.indexOf('Presto') > -1, //opera内核 webKit: u.indexOf('AppleWebKit') > -1, //苹果、谷歌内核 gecko: u.indexOf('Gecko') > -1 && u.indexOf('KHTML') == -1, //火狐内核 mobile: !!u.match(/AppleWebKit.*Mobile.*/)||!!u.match(/AppleWebKit/), //是否为移动终端

What is a font's “EM box/EM unit” and where is it defined

倖福魔咒の 提交于 2020-02-23 11:26:50
问题 In the CSS3 CSS Fonts Module Level 3 (candidate Oct 13), there is a single reference to the "EM box" and one to the "EM unit" in section 2.3. The quote follows: [The font-size] property indicates the desired height of glyphs from the font. For scalable fonts, the font-size is a scale factor applied to the EM unit of the font. (Note that certain glyphs may bleed outside their EM box.) For non-scalable fonts, the font-size is converted into absolute units and matched against the declared font

How to change browser User-Agent Header with javaScript?

折月煮酒 提交于 2020-02-16 00:42:08
问题 Following code changes property printed (when accessed through javaScript) by browser console and not the actual Use-Agent string sent with the header. Object.defineProperty(navigator, 'userAgent', { get: function () { return 'Mozilla/5.0 (Windows NT 6.2; WOW64; rv:28.0) Gecko/20100101 Firefox/28.0)'; } }); 回答1: This isn't possible from the page itself. The user agent string (as sent in the HTTP request headers) can only be changed via browser extension or browser configuration. 来源: https:/

HttpUrlConnection redirection does not use request properties of orginial connection

烂漫一生 提交于 2020-02-02 07:14:41
问题 Setting properties of a connection do not carry forward to redirected connections HttpURLConnection mConnection = (HttpURLConnection) url.openConnection(); mConnection = addRequestProperty("User-Agent", "Mozilla"); InputStream stream = mConnection.getInputStream(); if there is a 302 code, mConnection is redirected, but the user-agent is "Java/1.5.0_28" . Any suggestion how to handle this? 回答1: It didn't change, it started out that way. addRequestProperty() won't override the default. Use

Why url.exists returns FALSE when the URL does exists using RCurl?

偶尔善良 提交于 2020-01-25 21:42:08
问题 For example: if(url.exists("http://www.google.com")) { # Two ways to submit a query to google. Searching for RCurl getURL("http://www.google.com/search?hl=en&lr=&ie=ISO-8859-1&q=RCurl&btnG=Search") # Here we let getForm do the hard work of combining the names and values. getForm("http://www.google.com/search", hl="en", lr="",ie="ISO-8859-1", q="RCurl", btnG="Search") # And here if we already have the parameters as a list/vector. getForm("http://www.google.com/search", .params = c(hl="en", lr=