Skip to content

Instantly share code, notes, and snippets.

@meleyal
Created June 24, 2011 10:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save meleyal/1044572 to your computer and use it in GitHub Desktop.
Save meleyal/1044572 to your computer and use it in GitHub Desktop.
Modernizr test for File API support
From 509d6f93d51efaee274d267c030ac2855aa799d7 Mon Sep 17 00:00:00 2001
From: meleyal <william.meleyal@gmail.com>
Date: Fri, 1 Apr 2011 00:25:34 +0200
Subject: [PATCH] add test for File API support
---
modernizr.js | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/modernizr.js b/modernizr.js
index 93366aa..0cbdf20 100644
--- a/modernizr.js
+++ b/modernizr.js
@@ -716,6 +716,12 @@ window.Modernizr = (function(window,document,undefined){
tests['applicationcache'] = function() {
return !!window.applicationCache;
};
+
+
+ // Safari 5 supports most of the File API, but not FileReader
+ tests['fileapi'] = function(){
+ return !!window.FileReader;
+ };
// Thanks to Erik Dahlstrom
--
1.7.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment