forked from mozilla/django-moz-header
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmobilefeatures.js
35 lines (29 loc) · 834 Bytes
/
mobilefeatures.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*
* In general we assume modern on the mobile site. We don't need full
* modernizr, but there are features we want to test for.
*/
// Tests below are copied from Modernizr
/*!
* Modernizr v1.7
* http://www.modernizr.com
*
* Developed by:
* - Faruk Ates http://farukat.es/
* - Paul Irish http://paulirish.com/
*
* Copyright (c) 2009-2011
* Dual-licensed under the BSD or MIT licenses.
* http://www.modernizr.com/license/
*/
(function() {
"use strict";
// Inline SVG is not in iPhone or Android webkit _yet_, so we need to fallback.
function inlineSVG() {
var div = document.createElement('div');
div.innerHTML = '<svg/>';
return (div.firstChild && div.firstChild.namespaceURI) == 'http://www.w3.org/2000/svg';
}
if(!inlineSVG()) {
document.documentElement.className += ' ' + 'no-inlinesvg';
}
}());