user-agent

Getting the User Agent with JavaScript

半世苍凉 提交于 2019-11-27 00:45:45
I'd like to get a script that can grab the user's user agent and prop it to an attribute. I'm making a website problems contact form and I usually need to know what browser the user is using. How can I detect the user agent string and prop it as the value of an input element. My html looks something like: <input type="hidden" id="UserAgent" name="User Agent" /> I want the user agent to be added to that as the value attribute so it would look like: <input type="hidden" id="UserAgent" name="User Agent" value="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/534.53.11 (KHTML, like Gecko

How to get UIWebView User-Agent

做~自己de王妃 提交于 2019-11-27 00:44:26
问题 I've got a problem working with one remote server. My app makes a request to a server using [NSData initWithContentsOfURL:] method and as a response I get website's url which I open in UIWebView . The problem is that those requests have different User-Agent and server can't serve me correct because it expects that I send all requests with the same User-Agent. I know how to change User-Agent (e.g Change User Agent in UIWebView (iPhone SDK)) but what I really want it is somehow to get UIWebView

.htaccess Allow All from Specific User Agent

旧时模样 提交于 2019-11-27 00:24:49
问题 I have a website I am developing that is also going to be pulled into a web app. I have the following code in my .htaccess file to prevent access from ANYONE that is not on my allowed IP: Order deny,allow Deny from all AuthName "Restricted Area - Authorization Required" AuthUserFile /home/content/html/.htpasswd AuthType Basic Require valid-user Allow from 12.34.567.89 Satisfy Any QUESTION: I would like to add an Allow from rule that will ALSO allow a specific HTTP user agent access to the

How to use curl to get a GET request exactly same as using Chrome?

主宰稳场 提交于 2019-11-27 00:12:08
问题 I have a web api http://something.com/api and I want to use GET to get the response body. This is my command: curl "http://something.com/api" Of course, it fails and gives an error message. When I use Chrome and input the above url, everythings correct. However I do the same things with Firefox, the url gives me the same error message. I try to repeat the action with Chrome extension DHC, the request gives correct response again. After some searching, I believe that the curl option --user

Operating System from User-Agent HTTP Header [closed]

与世无争的帅哥 提交于 2019-11-27 00:08:46
Is there a good, up-to-date listing anywhere that maps User-Agent HTTP Header strings --> operating systems? Nescio Here's a quick list... let me know if I missed one you are interested in. http://www.geekpedia.com/code47_Detect-operating-system-from-user-agent-string.html : // Match user agent string with operating systems Windows 3.11 => Win16, Windows 95 => (Windows 95)|(Win95)|(Windows_95), Windows 98 => (Windows 98)|(Win98), Windows 2000 => (Windows NT 5.0)|(Windows 2000), Windows XP => (Windows NT 5.1)|(Windows XP), Windows Server 2003 => (Windows NT 5.2), Windows Vista => (Windows NT 6

How can I fool a site that looks at the JavaScript object 'navigator' to see that I'm not on Windows?

大城市里の小女人 提交于 2019-11-26 23:13:45
问题 I am trying to browse a website, however, it only works under Windows and Mac because they use the navigator.platform from JavaScript to find out the architecture I am running on. Of course, they also use the browser's user agent, but that was easy to spoof. Here is the .js in question: http://pastebin.com/f56fd608d. The code responsible for browser detection is at the top. Is there any way of changing the .js file before the site runs, or something similar, so I can eliminate the check?

Android, webview user agent vs browser user agent

倖福魔咒の 提交于 2019-11-26 22:57:11
问题 I'm building my website and I want to know whether the user is using Android's browser or an app with a webview. is it possible ?? 回答1: FROM: http://googlewebmastercentral.blogspot.com/2011/03/mo-better-to-also-detect-mobile-user.html With a User-Agent like this: Mozilla/5.0 (Linux; U; Android 3.0; en-us; Xoom Build/HRI39) AppleWebKit/534.13 (KHTML, like Gecko) Version/4.0 Safari/534.13 since there is no “mobile” string, serve this user the desktop version (or a version customized for Android

order of directives in robots.txt, do they overwrite each other or complement each other?

时光怂恿深爱的人放手 提交于 2019-11-26 21:59:17
问题 User-agent: Googlebot Disallow: /privatedir/ User-agent: * Disallow: / Now, what are disallowed for Googlebot: /privatedir/, or the whole website / ? 回答1: According to the original robots.txt specification: A bot must follow the first record that matches its user-agent name. If such a record doesn’t exist, it must follow the record with User-agent: * (this line may not appear in more than one record). If such a record doesn’t exist, it doesn’t have to follow any record. So a bot never follows

Check String and User Agent

那年仲夏 提交于 2019-11-26 21:40:39
问题 I am trying to setup a PHP snippet that checks if 2 conditions are met and if they are, it echoes some text. The conditions are: That the query string equals a certain value. That the browser is Firefox. It's checking the query string properly but, it doesnt seem to be working for the browser (user agent). See below: <?php function get_user_browser() { $u_agent = $_SERVER['HTTP_USER_AGENT']; $ub = ''; if(preg_match('/Firefox/i',$u_agent)) { $ub = "firefox"; } else { $ub = "other"; } } if

PHP cURL how to add the User Agent value OR overcome the Servers blocking cURL requests?

我怕爱的太早我们不能终老 提交于 2019-11-26 20:16:58
问题 I am transferring an Object Array. I have a cURL client (submitter) on own Server and listening script on other's Server , which one is not under my control. Then i think there, they are blocking the incoming cURL requests because when i test with the normal HTML <form> , it is working. But not via cURL anyway. So i think they have done some restriction to cURL. Then my questions here are: Can a Server restrict/block the cURL incoming requests? If so, can i trick/change the HTTP Header (User