user-agent

Checking User Agent in Wicket

橙三吉。 提交于 2019-12-04 09:10:21
I am using wicket 1.5 and I am not able to see in the getClientInfo() method (WebRequest)RequestCycle.get().getRequest() I saw the other place this code WebClientInfo clientInfo = (WebClientInfo)WebRequestCycle.get().getClientInfo(); But I am not able to see any WebRequestCycle in Wicket 1.5. Any ideas how to check the user agent in Wicket 1.5? Christoph Leiter The easiest way is to use WebSession.get().getClientInfo().getUserAgent(); On newer Wicket Versions (6 or newer), you should use: WebClientInfo clientInfo = new WebClientInfo(getRequestCycle()); System.out.println("Client: " +

Import from web - set user agent in Mathematica

浪尽此生 提交于 2019-12-04 08:23:12
问题 when I connect to my site with Mathermatica ( Import["mysite","Data"] ) and look at my Apache log I see: 99.XXX.XXX.XXX - - [22/May/2011:19:36:28 +0200] "GET / HTTP/1.1" 200 6268 "-" "Mathematica/8.0.1.0.0 PM/1.3.1" Could I set it to be something like this (when I connects with real browser): 99.XXX.XXX.XXX - - [22/May/2011:19:46:17 +0200] "GET /favicon.ico HTTP/1.1" 404 183 "-" "Mozilla/5.0 (X11; Linux i686) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.68 Safari/534.24" 回答1:

Illegal characters in path depending on User-Agent?

无人久伴 提交于 2019-12-04 07:43:00
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 Gecko) Version/8.0 Mobile/12A4345d Safari/600.1.4 Everything else is 100% the same. In my case, the

How can I spoof the user agent of a JavaScript GET request?

最后都变了- 提交于 2019-12-04 07:14:36
How can I spoof the user agent of a JavaScript GET request? setRequestHeader with User-Agent isn't allowed: xmlHttpRequest.setRequestHeader("User-Agent", "..."); tskuzzy You can't do this in a half-decent browser because of security issues surrounding it. You don't want XSS scripts to be changing request headers and running rampant on your site. However I believe there's a workaround in IE if you use VBScript : MyHttp.setRequestHeader "User-Agent", "MyCustomUser" The alternative is to have a web page on your site dedicated to forwarding a GET request, changing the appropriate headers as

SECURITY_ERR: DOM Exception 18 when applying document.domain on both sites. How do I resolve this?

混江龙づ霸主 提交于 2019-12-04 06:33:26
I have a page at an internal server, server1.mydomain.com/page.jsp and another page at a different internal server, 10.x.x.x:8081/page.aspx. On server1.mydomain.com, I set document.domain in page.jsp like this: //page.jsp on server1.mydomain.com document.domain = document.domain; When I issue an alert on document.domain, it comes up as server1.mydomain.com. On the 10.x.x.x server, I set document.domain in page.aspx, as a result, like this: //page.aspx on 10.x.x.x document.domain = "server1.mydomain.com"; // test if same-origin policy violation occurs document.getElementById("div_el").innerHTML

How to use Piwik device detector in php project?

℡╲_俬逩灬. 提交于 2019-12-04 06:24:49
I want to use php device detector that is part of famous Piwik project, but i can't understand how to include and use the code in my php code? i don't want to use composer. I wrote: <?php include 'DeviceDetector.php'; use DeviceDetector\DeviceDetector; use DeviceDetector\Parser\Device\DeviceParserAbstract; $dd = new DeviceDetector($_SERVER['HTTP_USER_AGENT']); $dd->parse(); $clientInfo = $dd->getClient(); var_dump($clientInfo); But it doesn't work. i get this error: Fatal error: Uncaught exception 'Exception' with message 'client parser not found' in D:\DeviceDetector.php:214 Stack trace: #0 D

How to get ip address, referer, and user agent in ruby?

烈酒焚心 提交于 2019-12-04 06:23:37
I want to log user's ip address, referer, and user agent. In PHP, I can get them from the following variables: $_SERVER['REMOTE_ADDR'] $_SERVER['HTTP_REFERER'] $_SERVER['HTTP_USER_AGENT'] How to get them in ruby? timaschew You need the array request.env request.env['REMOTE_ADDR']: PHP is embedded in a web server. Ruby is a general-purpose language: if you need a web server context, you'll have to install it yourself. Fortunately, it's easy. One of the easiest ways to get started is with Sinatra . Install the gem: gem install sinatra Then create myapp.rb: require 'sinatra' get '/' do request

Is it possible to detect the Android captive portal browser?

喜夏-厌秋 提交于 2019-12-04 05:36:24
I have a captive portal which, as of Android 5.0+ Lollipop, launches in Android's Captive Portal Browser rather than the device's default browser. I need to somehow detect if they are in the captive portal browser (as opposed to a regular web browser) and if so, show different content. Is it possible, by examining the User Agent, or through Javascript, to detect if they are within a Captive Portal Browser window? I have looked at the user agents on my Android 5.1 device, but I can't see anything to differentiate them: CAPTIVE PORTAL BROWSER: Mozilla/5.0 (Linux; Android 5.1; Elite 5 Build

What is the iPad2 User-Agent string?

风格不统一 提交于 2019-12-04 04:35:49
Does anyone know the user-agent string of the just released iPad2? This is my most recent user agent record from my ipad 2: Mozilla/5.0(iPad; U; CPU OS 4_3 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8F191 Safari/6533.18.5 iPad 2 with iOS 5.1 Mozilla/5.0 (iPad; CPU OS 5_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9B176 Safari/7534.48.3 来源: https://stackoverflow.com/questions/5677068/what-is-the-ipad2-user-agent-string

Custom user agent string or header without modifying cordova libs

三世轮回 提交于 2019-12-04 03:20:11
I have an Android Phonegap/Cordova app that interacts with an ASP.NET MVC web application. I am trying to detect server side whether or not the web page is being loaded from a browser or from my Phonegap/Cordova app. There are a few methods I have considered: Change the User Agent string. I found this stackoverflow link that describes a way to make that work. Unfortunately, it did not work for me. The request object did not have the custom user agent string. Include a custom header value. This can be done by modifying the cordova library (see this stackoverflow link .) Modifying libraries is