user-agent

Illegal characters in path depending on User-Agent?

末鹿安然 提交于 2019-12-21 13:05:17
问题 I have two identical calls to ASP.NET, the only difference is the User-Agent. I used Fiddler to reproduce the issue. The HTTP request line is: PUT http://localhost/API/es/us/havana/club/tickets/JiWOUUMxukGVWwVXQnjgfw%7C%7C214 HTTP/1.1 Works with: User-Agent: Mozilla/5.0 (Linux; Android 4.3; Nexus 10 Build/JSS15Q) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2307.2 Safari/537.36 Fails with: User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 8_0 like Mac OS X) AppleWebKit/600.1.3 (KHTML, like

Php : Finding Chrome and Safari Browsers

◇◆丶佛笑我妖孽 提交于 2019-12-21 08:16:18
问题 I use below code to find user agent, $user_agent = $_SERVER['HTTP_USER_AGENT']; if (preg_match('/MSIE/i', $user_agent)) { echo "Internet Explorer"; } if (preg_match('/Firefox/i', $user_agent)) { echo "FireFox"; } if (strpos( $user_agent, 'Chrome') !== false) { echo "Google Chrome"; } if (strpos( $user_agent, 'Safari') !== false) { echo "Safari"; } if (preg_match('/Opera/i', $user_agent)) { echo "Opera"; } ?> But my chrome browser returning below useragent suddenly Mozilla/5.0 (Macintosh;

Chrome use-mobile-user-agent not working

三世轮回 提交于 2019-12-21 04:54:10
问题 Chrome use-mobile-user-agent not working Running chrome from command line with flag --use-mobile-user-agent does not open the browser in mobile context (user-agent). chrome --use-mobile-user-agent= true Note: passing user-agent option does work, but i feel its not the right way of doing things as chrome offers you this flag to boot in mobile context. --user-agent= Mozilla/5.0 (iPhone; U; CPU iPhone OS 5_1_1 like Mac OS X; ar) AppleWebKit/534.46.0 (KHTML, like Gecko) CriOS/19.0.1084.60 Mobile

Change User-Agent and remove App Name and defaults iOS

让人想犯罪 __ 提交于 2019-12-21 03:55:13
问题 I am trying to change the User-Agent in iOS, however when I add my custom User-Agent it appends it to the existing User-Agent that contains my app name. This is the code I am using: NSMutableURLRequest *request = [client requestWithMethod:@"POST" path:endpoint parameters:nil]; [request addValue:@"MyUserAgent (iPhone; iOS 7.0.2; gzip)" forHTTPHeaderField:@"User-Agent"]; And the User-Agent appears like this: MyAppName/1.0 (iPhone; iOS 7.0.2; Scale/2.00),MyUserAgent (iPhone; iOS 7.0.2; gzip) I

How to detect Android's version number in Firefox for Android?

好久不见. 提交于 2019-12-21 02:20:26
问题 For a website we want to show a link in the play store if the user comes with an Android 4+ device. All browsers we tested sent the version number of Android in their user-agent string, except one: Firefox for Android. Firefox just sends this: Mozilla/5.0 (Android; Mobile; rv:19.0) Gecko/19.0 Firefox/19.0 and even with some JavaScript I can't find any evidence for the version number: <script language="JavaScript"> document.write(navigator.appVersion + "\n<br/>OS CPU: " + navigator.oscpu); <

Is it possible to use HttpBrowserCapabilities from a c# console application?

倾然丶 夕夏残阳落幕 提交于 2019-12-20 12:12:39
问题 I need to parse UserAgent strings from a console app and this seems like a simple way to do it, but I obviously don't have an HttpRequest object and can't seem to make a fake one with a User-Agent header (I get platform not supported exception). Is there any way to do this, or should I start exploring other alternatives to user agent parsing? 回答1: The User-Agent header can be parsed by the HttpBrowserCapabilities class with the help of a BrowserCapabilitiesFactory, as follows: var userAgent =

Is there a way to detect user agent in Rails 3.1 [duplicate]

我们两清 提交于 2019-12-20 10:18:04
问题 This question already has answers here : Closed 8 years ago . Possible Duplicate: Auto detect mobile browser (via user-agent?) Rails 3: HTTP_USER_AGENT Is there a way to detect the user agent from a current visitor? I'm currently working on a project to display video files. But for the ipad, iphone / samsung galaxy tab / internet explorer / firefox. I need to display video's is there a solid way to check which browser is visiting my rails app? Thanks guys! 回答1: Yep, just use this request.env[

Simple way to identify iOS user agent in a jQuery if/then statement?

允我心安 提交于 2019-12-20 09:44:57
问题 Exactly like it sounds.. Is there some magical and easy way to say: if (user agent is iOS) { if (browserRatio >=1.5) { $container.css('min-height', '360px'); } else { $container.css('min-height', '555px'); } } 回答1: Found it. if (navigator.userAgent.match(/(iPod|iPhone|iPad)/)) { if (browserRatio >=1.5) { $container.css('min-height', '360px'); } else { $container.css('min-height', '555px'); } } 回答2: I know you're asking about jquery in particular, but IMO, you almost certainly want to use CSS3

Desktop/OS User Agents in Javascript

旧巷老猫 提交于 2019-12-20 07:15:19
问题 Below is my current script: <script type="text/javascript"> if (navigator.userAgent.indexOf('BlackBerry')!= -1){ document.write('<link rel="stylesheet" href="/m/css/mobile.css" type="text/css" />'); } else if (navigator.userAgent.indexOf('iPhone')!= -1) { document.write('<link rel="stylesheet" href="/m/css/smartmobile.css" type="text/css" />'); }else if (navigator.userAgent.indexOf('Android')!= -1) { document.write('<link rel="stylesheet" href="/m/css/smartmobile.css" type="text/css" />'); }

ipad user agent changes during use?

老子叫甜甜 提交于 2019-12-20 03:23:22
问题 In the logs of our website, we are occasionally seeing the user agent of an iPad 'switch' from one set of requests to the next. On one set of requests that occur simultaneously, the user agent will look like this (which is the style of user agent we see most of the time for iPads): mozilla/5.0+(ipad;+u;+cpu+os+4_2_1+like+mac+os+x;+en-us)+applewebkit/533.17.9+(khtml,+like+gecko)+version/5.0.2+mobile/8c148+safari/6533.18.5 The user then clicks a link or a button; the next series of requests