Questions tagged [browser-feature-detection]

Feature detection is the practice in web development of determining whether a browser or device supports a certain feature, so as to provide fallbacks for older browsers or allow enhanced functionality in more capable modern browsers.

Feature detection is the practice in web development of determining whether a browser or device supports a certain feature, so as to provide fallbacks for older browsers or allow enhanced functionality in more capable modern browsers.

160 questions
8
votes
1 answer

Feature detection for ability to drop file over HTML file input

Can we detect whether a browser supports dropping a file over an ? For example, this is possible in Chrome but not in IE8. Modernizr.draganddrop is a possibility but is it the right choice? I'm not adding any custom drag/drop…
Danyal Aytekin
  • 4,106
  • 3
  • 36
  • 44
8
votes
2 answers

How to identify buggy behavior in "input" event without browser detection?

I'll start with the question. When a specific browser has a buggy implementation of a feature and your javascript needs to know whether the current browser has that buggy implementation or not so it can use an alternate strategy, how do you figure…
jfriend00
  • 683,504
  • 96
  • 985
  • 979
7
votes
4 answers

How to detect if browser support specified css pseudo-class?

What's concept of detecting support of any css pseudo-class in browser through JavaScript? Exactly, I want to check if user's browser supports :checked pseudo-class or not, because I've made some CSS-popups with checkboxes and needs to do fallbacks…
7
votes
0 answers

Mobile Safari: Detect if within Gmail App

I've created a basic web app and it has a little "click here to add to home screen" pop up that appears if it's not in stand alone mode (i.e. not on your home screen already). I have a basic registration system that emails the users links to the app…
Primus202
  • 648
  • 7
  • 24
7
votes
1 answer

Using Modernizr to test browser support for css calc()

How can I test if a browsers support the CSS3 calc() property using Modernizr? I have tried: if (Modernizr.testProp('cssCalc')) { console.log('CSS calc() supported'); } but this only returns "undefined" in the console. (I am using…
elizabethmeyer
  • 953
  • 2
  • 9
  • 13
6
votes
4 answers

the best way to detect browser in js

There are lots of ways for browser detecting in JavaScript. As far as i know, using navigator.userAgent or detecting features (like XMLHttpRequest) and so on. Can anybody tell me which way is the best and most effective?
vikingmute
  • 412
  • 2
  • 10
  • 24
6
votes
2 answers

javascript: detect if XP or Classic windows theme is enabled

Is there any way to detect which windows XP theme is in use? I suspect that there is no specific api call you can make, but you may be able to figure it out by checking something on some DOM element, ie feature detection. Another question: does the…
mkoryak
  • 57,086
  • 61
  • 201
  • 257
6
votes
1 answer

Check for support of Javascript delete functionality

In Javascript you can delete an object property: var o = { x: 1, y: 2 }; var wasDeleted = delete o.x; Now o.x should be undefined and wasDeleted is true. However you can only delete native objects, and unfortunately the browsers seem to have…
Keith
  • 150,284
  • 78
  • 298
  • 434
6
votes
4 answers

Feature detection for transtionend/animationend event?

I'm looking for a cleaner way to feature detect the actual name of the transitionend. I've seen a lot of examples just brute force adding handlers to all the variations. Also, I don't want to have to rely on jQuery (or similar framework). I'm…
mckamey
  • 17,359
  • 16
  • 83
  • 116
5
votes
4 answers

Detecting browsers that don't support onunload/onbeforeunload

Of all the browsers, it seems that only Opera doesn't support onunload/onbeforeunload events. (It's been fifteen years now, Opera!) Solutions for this issue have been covered many times, here for example: onbeforeunload support…
5
votes
1 answer

How to determine if the browser supports data URIs for hyperlinks

Is there a way to determine whether a browser supports using data URIs for hyperlinks, besides browser sniffing? Here's the context: I'm creating a link that either downloads a CSV file of information generated via JavaScript using a handy data URI…
5
votes
2 answers

Detect if browser supports data uri scheme with iframes

Internet Explorer does not support the data uri scheme for iframe urls (see http://msdn.microsoft.com/en-us/library/cc848897%28v=vs.85%29.aspx). Other browsers do. As browser detection is loaded with testing and future-proofing problems, I want to…
5
votes
4 answers

/*@cc_on and IE6 detection

When researching JavaScript conditional comments for IE, I stumbled upon @cc_on. This seems to work. However, the wikipedia entry on conditional comments provides the following code for more robust IE detections, specifically IE6: /*@cc_on …
5
votes
2 answers

Browser feature detection: spell checking?

All the decent browsers (Chrome, FX, etc) now support built-in spell checking. However the popular but rubbish axis of IE doesn't (not even IE8 - pointless 'accelerators': yes, much needed dictionary support: no). Unless you download an excellent…
Keith
  • 150,284
  • 78
  • 298
  • 434
4
votes
2 answers

JavaScript detect if hardware acceleration is enabled

Is it possible to detect to see if a browser has support for hardware accelerated page rendering and is it also possible to see if it has been enabled? I am aware that Firefox 4, IE9 and Chrome support it, but it may or may not be enabled due to the…
matsko
  • 21,895
  • 21
  • 102
  • 144
1 2
3
10 11