user-agent

How to check for Crosswalk WebView user agent?

对着背影说爱祢 提交于 2019-12-24 05:26:22
问题 I need to check if a mobile user is accessing the website through a Crosswalk WebView and enable/disable some niceties. How can I check if user is accessing using Crosswalk WebView? What is the user string for Crosswalk WebView? 回答1: Found the correct user agent string for crosswalk webview on GitHub: if(navigator.userAgent.toLowerCase().indexOf('crosswalk') > -1) { // this is crosswalk view } else { // this is NOT crosswalk view } 来源: https://stackoverflow.com/questions/36945869/how-to-check

Regex to detect IE9 and below?

白昼怎懂夜的黑 提交于 2019-12-24 04:23:29
问题 I am trying to write a regex pattern in Java to detect if a user agent is less than or equal to Internet Explorer 9. There are quite a few examples here: http://www.useragentstring.com/pages/Internet%20Explorer/ The main gist is there will be a string in the user agent string called: "MSIE XXXX). My current regex pattern is this: MSIE ([1-9]|9) Which seems to work except there are problems when I do MSIE 10.0 or MSIE 11.0 it matches. Any ideas on how to only match 1-9 and no 10.0 or 11? 回答1:

Change IE user agent

浪尽此生 提交于 2019-12-24 01:44:13
问题 I'm using WatiN to automate Internet Explorer, and so far it's been great. However, I would really like to be able to change the user agent of IE so the server thinks it's actually Firefox or some other browser. A Firefox useragent string look something like: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13 With the following code RegistryKey ieKey = Registry.LocalMachine.CreateSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\5.0

JavaScript User Agents API to fetch and filter by browser class type [closed]

一曲冷凌霜 提交于 2019-12-24 00:52:01
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed last year . Is there any user agent retrieval API? So that to filter by browser class type, like mobile , desktop , bot , etc. From this web site - that claims to have the largest database of User Agents, being collected since 2006, I wrote this simple tool to get User Agents from it (via the browser at this time): function

php script that detect from user agent what is the device (mobile)?

徘徊边缘 提交于 2019-12-23 20:30:16
问题 I am try to write a php script that return the device from the user agent in the header. the problem that i see that is not simple to do a regular expression, because the different between the device (am i wrong?) so i want an updated list of mobile device according to the user agent I found this list : List of user agents for mobile phones I try to find an updated xml / feed that i can take all the kinds or other way you think that best to do this . thanks. 回答1: I use this script in a

Obtaining browser and version using Coldfusion

左心房为你撑大大i 提交于 2019-12-23 18:38:14
问题 Is there something built into Coldfusion that would let me know the browser and version number surfing my site? Are there existant libraries that would enable me to do this? My google-fu hasn't shown many things other than simple if statements detecting IE. I did do a dump of the cgi.http_user_agent variable in Chrome: Mozilla/5.0 (Windows NT 5.1) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.77 Safari/534.24 There's three different browsers mentionned in there! Doing an if statement

Create WURFL patch matching partial user-agent

五迷三道 提交于 2019-12-23 18:26:01
问题 I'm using WURFL to identify whether a user is on a mobile device. Some User-Agent strings are incorrectly recognized as mobile devices which in turn causes the content-type to be set incorrectly. Here an example of a real life user agent behaving like this: Mozilla/5.0 (GTmetrix http://gtmetrix.com/; X11; U; Linux i686 (x86_64); en-US; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13 The content-type then is set to application/vnd.wap.xhtml+xml instead of text/html . I would like to add an entry to

All possible ways to detect TV as client side browser for CSS purposes

我的梦境 提交于 2019-12-23 09:59:41
问题 I have web application which follows responsive web design techniques. I'd like to serve different (bigger) font size for TV and different (smaller) for screen even when both have the same resolution. Why? Because when user uses 32" monitor as screen, he probably sits closer to it than user who uses it as TV. The code: body {font-size:14px;} @media (min-width:1900px) {body {font-size:20px;}} @media tv and (min-width:1900px) {body {font-size:30px;}} should do all the work (if I understand how

Why should I access a url using a User Agent?

妖精的绣舞 提交于 2019-12-23 02:28:04
问题 I had a similar code as in this question. Extending the code, in accepted answer, worked for me too. Before this time, I used this type of codes and never meet any exception. Now, my questions are: Why should I use the USER AGENT? Why it became necessary to use in my program? Is it necessary to use in every program? If yes, how my program ran so good before? If no, why I have to handle this now? How the string "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)" is generated? (I want to know

DOMDocument::loadHTMLFile() modify user agent

夙愿已清 提交于 2019-12-22 12:09:11
问题 Im using PHP to load a website in a DOM Tree. Is there a way to modify the user agent that is sent using DOMDocument::loadHTMLFile() ? function parseThis($url) { $html = new DOMDocument(); $html->loadHtmlFile( $url ); return $html } 回答1: Change the user_agent value in php.ini , which should be sent in anything making use of the http stream wrapper like DOMDocument::loadHtmlFile(), file_get_contents() , etc. $fake_user_agent = "Mozilla/5.0 (X11; Linux i686) AppleWebKit/536.11 (KHTML, like