0

I want to run some JavaScript only if the browser doesn't natively support autofill. (I'm not looking to detect autofill events, or turn autofill off, but just see if the browser supports the feature.) Modernizr seems to come up short, but maybe I'm just not looking hard enough - does anybody know if I can detect if a browser has autofill support?

carpeliam
  • 6,691
  • 2
  • 38
  • 42
  • possible duplicate of [Detecting Browser Autofill](http://stackoverflow.com/questions/11708092/detecting-browser-autofill) – Codeman Apr 27 '15 at 18:13
  • 2
    I know it's not a very satisfying answer, but unfortunately it is the answer. There's no simple way as far as I know to detect it. Your best bet is to always use your code. Most modern browsers support autofill these days anyways, it is typically only disabled by the user – Codeman Apr 27 '15 at 18:14
  • @Pheonixblade9 the question you're linking to is about detecting the autofill event, but I'm looking to detect the feature. Autofill support is pretty widely supported on desktop, but as far as I know, completely unsupported on mobile. – carpeliam Apr 27 '15 at 18:30
  • really? My Android phone has autofill.. but I use Chrome on my phone. – Codeman Apr 27 '15 at 19:47
  • ah, you're right - i'll amend that to "completely unsupported on iOS Safari." :) – carpeliam Apr 28 '15 at 00:25
  • Perhaps you should filter based on user agent then? – Codeman Apr 28 '15 at 00:25
  • @Pheonixblade9 certainly doable, but this has all the problems inherent in user agent detection vs feature detection, so I was hoping that feature detection for this existed. If not, then I'll reevaluate. Thanks! – carpeliam Apr 28 '15 at 00:42
  • It's also possible that modernizr would work for you - on my phone so I can't look it up, but take a look! – Codeman Apr 28 '15 at 00:56
  • @carpeliam - autofill can mean a number of different things - do you mean auto_complete_? – Patrick Apr 28 '15 at 02:28

0 Answers0