user-agent

HTTP request header: UserAgent variable

蹲街弑〆低调 提交于 2019-12-18 10:43:02
问题 When sending a HTTP request, IE sends the User-Agent variable to the server. A possible value (as seen by the network debugger): User-Agent: Mozilla /5.0 (Compatible MSIE 9.0;Windows NT 6.1;WOW64; Trident/5.0) My question: How does IE (or any other browser) find out this variable? I'm asking this because when visiting some websites, this variable is different than others and I'd like to trace where the change is coming from. 'Compatibility settings' is one option, but I think there is more to

How to set User-Agent in WebClient

∥☆過路亽.° 提交于 2019-12-18 09:28:25
问题 I used the code below to open a stream request to a youtube video, but it always return an exception "The remote server returned an error: NotFound". Then I tried to use Fiddler to detect the problem, and I saw that the WebClient auto set User-Agent field to NativeHost, not my User-Agent as below. My code to send a request to youtube: private static Task<string> HttpGet(string uri) { var task = new TaskCompletionSource<string>(); var web = new WebClient(); web.OpenReadCompleted += (sender,

How to set navigator userAgent?

◇◆丶佛笑我妖孽 提交于 2019-12-18 08:26:09
问题 Ok this is an edge case I have managed to land in. I am testing my app on the new Tizen OS. My JS code has thousands of navigator checks. Something like: navigator.userAgent.toLocaleLowerCase().indexOf("android") || navigator.userAgent.toLocaleLowerCase().indexOf("iPad") Now Tizen OS's userAgent on my test device does not have either of those strings. A lot of my css and JS is breaking as a result. I am in the POC mode right now and do not want to spend time in adding an additional check to

Retrieve User-Agent programmatically

吃可爱长大的小学妹 提交于 2019-12-17 22:36:32
问题 Is there a way to retrieve Browser's user-agent without having a WebView in activity? I know it is possible to get it via WebView : WebView view = (WebView) findViewById(R.id.someview); String ua = view.getSettings().getUserAgentString() ; But in my case I don't have/need a webview object and I don't want to create it just for retrieving user-agent string. 回答1: If you don't have one you can try taking it like this String ua=new WebView(this).getSettings().getUserAgentString(); Edit- The doc

Load a javascript file and css file depending on user agent

拈花ヽ惹草 提交于 2019-12-17 21:04:07
问题 Just like in the title. I got two files: one is javascript file and one is css file. And if user-agent is an iPad I want to load those files - but only when user-agent is iPad . So below two lines are only loaded when user-agent is an iPad. how can i achieve that <link rel="stylesheet" href="/c/dropkick.css" type="text/css"/> <script src="/s/jquery.dropkick-1.0.0.js" type="text/javascript"></script> 回答1: if (navigator.userAgent.match(/iPad/i) != null){ // may need changing? var js = document

Email client detection

混江龙づ霸主 提交于 2019-12-17 20:46:33
问题 I have a project to send some email to end clients. My client need to know what exactly "Email Client" they use to read the mail. I know a hidden can get the open event and even the user agent they use, so by parsing user agent i can get most email clients info. But it's hard to detect some popular web mail clients like "Gmail", "Hotmail" and "Yahoo mail". Because user agent return is only the browser user agent string. Edit: i think i need a result more like this: here 回答1: You will not be

The CURL User Agent

眉间皱痕 提交于 2019-12-17 20:44:01
问题 So how can I check using codeigniter if the client is curl, and then return something different for it? 回答1: You can fake the user-agent when using cURL, so it's pointless depending on the user-agent sent when you KNOW it's a cURL request. For example: I recently wrote an app which gets the pagerank of a url from google. Now Google doesn't like this, so it allows only a certain user agent to access its pagerank servers. Solution? Spoof the user-agent using cURL and Google will be none the

Changing Android's default MediaPlayer User-Agent string

拜拜、爱过 提交于 2019-12-17 20:28:35
问题 Is it possible to change Android's default MediaPlayer User-Agent string? If so, how? 回答1: String referer="Referer: http://www.google.com/\r\n", useragent="USER-AGENT: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.134 Safari/537.36\r\n"; Map<String,String>mhead; VideoView vp; void prepareHeader(){ mhead=new HashMap<String,String>(); if(android.os.Build.VERSION.SDK_INT >20){ //if 5.X or higher, Fix User-Agent be force set by system mhead.put

Easiest Way OS Detection With PHP?

主宰稳场 提交于 2019-12-17 19:36:33
问题 I'm trying to figure out the visitor's OS is either a Windows, Mac or Linux using PHP(I don't need the version, distro info.. etc). There's several methods out there however they look a bit too complicated for this simple requirement. Are there any simple ways that could provide this sort of information yet still being quite reliable? Thanks in advance. 回答1: For an easy solution have a look here. The user-agent header might reveal some OS information, but i wouldn't count on that. For your

What is the User Agent string name for Microsoft Edge?

点点圈 提交于 2019-12-17 17:53:58
问题 I'm making a website and I want it to be compatible with the forthcoming Microsoft Edge when it comes out officially. To be more specific, the mobile version of it. Does anyone know what string will identify the Edge Mobile Browser (for example, "IE Mobile" identifies the mobile version of the Internet Explorer). 回答1: Microsoft Edge UA string: Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10136 I detail why in this blog post.