Hi
Is it possible to change the destination of a link based on whether the user has a mac or a PC using javascript?
To give an example: The Apple website allows download of Quicktime but it "knows" whether you are using a mac or a pc and directs you to the relevant page.
Background/Reason for doing this: I have built a website for som...
I need to display different HTML if the browser is IE6/IE7. I know conditional comments work fine if we're just talking about styling information but in this particular case it's the actual markup.
I will have an unordered list of images which will be png-24. They will have rounded corners (hence the need for the transparency provided b...
What's the best way to find out if a user is not using IE 7 or 8, Firefox, Safari, Chrome or Opera?
I want to show a message if they are not using one those browsers. In this case is it just easier to use browser sniffing?
...
I want to keep some statistics about users and locations in a database. For instance, I would like to store "Mozilla","Firefox","Safari","Chrome","IE", etc... as well as the versions, and possibly the operating system.
What I am trying to locate from Python is this string;
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.14) Gecko/200...
Due to IE's inability to fade transparent PNG's I have decided to change my fucntion to simply show PNG's if the user is using IE but to fade them if they are using any other browser. The function below works fine in IE and does what i expect it to but in any other browser i.e. Firefox, Safari it doesnt do anything, am i missing somethin...
I'm trying to run a very simple browser detect script and it executes just fine in Safari and Chrome (running on a Mac) but doesn't execute at all in Firefox. I can boil it down to the simplest possible form, and it still doesn't execute:
<script type="text/javascript">
if (navigator.userAgent.match(/^.*Chrome.*$/)) {break;}
else {
loca...
So I recently wanted to use the jQuery to do some browser detection and noticed that the previous methods were currently deprecated as of jQuery 1.3.
They now recommend that instead of testing for a browser, test for the features of the browser. Sounds like a good idea, but I cant figure out how to actually utilize this idea.
$("p").ht...
I'd like to use some CSS that is only supported by Firefox 3.5 at the moment (box-shadow: inset). For all the other browsers, via jQuery, I'll have to insert some extra divs with backgrounds to accomplish the effect.
I'd like to 'reward' FF3.5 users and not bother with that bit of script if they support the CSS.
It seems that the 'pr...
I am looking at some JS code from the 20th century, and they are using document.layers in code that is trying to get the current key code. What browser are they sniffing for?
i am about to replace the code with something like this:
var fn = function(event){
event = event || window.event;
var code = event.charCode || event.keyCode;
...
I want to set different themes to my Vaadin application, depending on the user agent.
In particular I want to distinguish at least between mobile devices (iPhone, Android,...) and desktop web browser.
Vaadin's API reveals two interesting classes:
BrowserInfo
WebBrowser
BrowserInfo seems to do the job perfectly for my needs, but fail...
I am working on a commercial web application that has a separate mobile browser version intended for the more capable devices (BlackBerry, iPhone, Android, etc). I don't want to do simple User Agent contains style logic and was looking at the various detection libraries. It seems like WURFL and Mobile Device Browser File are my best op...
There is a thread discussing Darwin notifications being sent after a screenshot is taken. Does this apply to websites viewed via Safari? Do the same restrictions apply to PC sytems? Would taking the picture via a Python script in Linux or running Safari in a VM circumvent detection?
...
What's the easiest way to tell if the browser is an IE 6 version in JavaScript? We're using MooTools here and Browser.Engine.trident will be true if it's IE, but what about the version number?
...
How do I determine the exact browser and version using javascript?
Thanks
...
The two available detection options for Windows in System.WebHttpBrowserCapabilities are:
Win16 Overloaded.
Win32 Overloaded.
If 64-bit isn't testable, the Win* properties seem rather useless. Besides parsing the user agent string, what's often used in place of these properties (maybe combinations of them)?
...
Which form of mobile detection should I use and why?
<meta name="viewport" content="width=320,initial-scale=1,maximum-scale=1.0,user-scalable=no" />
<link media="only screen and (max-device-width: 480px) and (min-device-width: 320px)" href="css/mobile.css" type= "text/css" rel="stylesheet">
<link media="handheld, only screen and (max-d...
I've been asked to find out a sensible way to make the majority of popular websites detect our browser - which is functionally complete, but is running on rather constrained hardware - as a "mobile" browser. The idea is that the heaviest popular websites seem to have mobile versions, which render much faster and fit better on the screen...
I have a modal pop up function on my website, but i don't want this to run if the browser is smaller than 480px. I have found that if I put an if statement such as:
if (window.innerWidth && window.innerWidth > 480) {
run function()
}
Then it should run only if the browsers innerWidth is > 480. However its not working and I think its...
I'm no good at Regular Expressions, really!
I would like to specifically detect WebKit browsers below version 525.
I have a regular expression [/WebKit\/[\d.]+/.exec(navigator.appVersion)] that correctly returns WebKit/5….…, really, I'd like it to return only the version number, but if the browser isn't WebKit, return null, or better s...
I am trying to write browser specific code. Is there a GWT API to find out which browser the client is using?
...