Seems like there are several ways to do this. I've found to use HttpContext.Current.Request.UserAgent, Request.ServerVariables("HTTP_USER_AGENT"), Request.Browser.Platform. Not sure which one is a more correct way to detect the OS version. Also, how do I get a list of the OS version string that client browser may send to web server. With that string, so I can filter it out in the code.
you can use Request.UserAgent.
User agent list
Related
I would like several instances of a web-page at once for testing.
Each time with a different user, and hence a different cookie.
To save time, I would like to run these tests in parallel.
The problem is that browser instances share cookies. Hence two users cannot be logged in on the same computer on the same browser in different windows at the same time.
I am looking for a way to run several pages with different cookies at the same time.
I am open to any solution: PhantomJS, Selenium, etc...
I am sure that the selenium instances of firefox dont share cookies. You can go with selenium. What happens is, when a selenium session is invoked, it creates a temporary profile of the browser in the TEMP directory(for Windows) and performs all the operations on it. You can do yours as follows Create a firefox profile, and configure it such that it never remembers the history and use that profile to invoke browser . For other browsers, keep the default settings as that they never remember the History
After login you can try deleting cookies for the current session by using selenium.deleteAllVisibleCookies() method of selenium RC.
As you may be aware, cookies are bound to domains.
If you could get each page or tab to use a slightly different domain (like an alias), then these cookies could coexist.
This domain aliasing could be accomplished using proxy server.
I've gotten results in the past using Privoxy.
Recently, I've tried using mitmproxy which I've written about here.
https://gist.github.com/sharedvices/6098357
How can I find my user's OS in my web app, using Spring-mvc framework ?
I assume I can scan the user-agent value, but is there any existing solution/lib ? (there is so much possible values for each os...)
Thanks
JavaScript can do a browser and OS detection. Use it to initialize a hidden field which is submitted through some form or sent to the server using AJAX.
Hi guys how to detect all the browsers that are installed in a system.By using Flex
You cannot do that from Flex or, as far as I can tell, from any web application. A web app being able to go through the list of installed applications on client machine is bad from a privacy and security point of view.
Maximum you can do is to read the user agent string from the HTTP headers (which can be easily modified and hence need not be accurate) to check what's the current browser being used to access your application. Even this, you can't do from Flex, you'll have to do it using some server script and send the information to the Flex app.
#Amargosh, while you do have to go through the server page to get client information, you can simply get browser information by executing Javascript from Flex:
var result:String = ExternalInterface.call("eval", "navigator.userAgent");
This will do the trick.
Is there a way to get a unique machine-specific system ID in a Flex application running in a browser, so that is can be used for example to determine if the machine is properly licensed to run the application?
I can't think of any way to do this based off the users machine or OS. The whole point of browser applications is to have them able to run anywhere, any time via a browser. To my knowledge Flash provides no information that could reasonable be converted into a unique machine ID for licensing purposes, not even the MAC address of a network card on the machine.
Personally, I think you'd be better off requiring a username/password for users to log in, and then using a session key stored in a cookie to allow the user to skip that step (e.g. a 'remember me on this computer' type of feature, such as GMail has). This has the advantage of the user being able to run the application from any PC they like.
Create a UUID inside flex
import mx.utils.UIDUtil;
var myUUID:string = UIDUtil.createUID();
I suppose if you want to get really clever you could encrypt this string with a locally known salt and generate some encrypted license key that can't be shared. You could change the salts or keys at regular intervals to enforce license expiration.
You will need to manage the key data on a backend somehow.
ILog Elixir does this, but they do it through a traditional install process. The swc files are watermarked, but when you enter your valid serial number unmarked swc files are unlocked and the source code is made available.
I don't have any details as to how they actually go about this, but it isn't directly through flex. Perhaps researching traditional software installation processes and unlocking encrypted data that way would produce the answer you are looking for.
You cannot really access machine specific information like MAC address or other ID's from a flex app. You should probably use some other technique like using ASP.NET or JSP.
I have an ASP.net Application that runs on the internal network (well, actually it's running on Sharepoint 2007).
I just wonder:
Can I somehow retrieve the name of the PC the Client is using? I would have access to Active Directory if that helps. The thing is, people use multiple PCs. So, I cannot use any manual/static mapping.
If possible, I do not want to use any client-side (read: JavaScript) code, but if it cannot be done server-side, JavaScript would be OK as well. ActiveX is absolutely out of question.
System.Web.HttpRequest.UserHostname as suggested in this answer just returns the IP :-(
But I just found this:
System.Net.Dns.GetHostEntry(Page.Request.UserHostAddress).HostName
That only works if there is actually a DNS Server to resolve the name, which is the case for my network.
Does System.Web.HttpRequest.UserHostname provide what you're looking for?