-
Notifications
You must be signed in to change notification settings - Fork 114
/
Copy pathfeature.min.js
2 lines (2 loc) · 2.64 KB
/
feature.min.js
1
2
/*! FEATURE.JS 1.1.3, http://featurejs.com */
!function(e,t,n){"function"==typeof define&&define.amd?define([],n):e.feature=n()}("undefined"!=typeof self?self:this,document,function(){"use strict";var r,o,c,e,n=document.documentElement,t=window.navigator||{},i={create:function(e){return document.createElement(e)},old:!!/(Android\s(1\.|2\.))|(Silk\/1\.)/i.test(t.userAgent),pfx:(r=document.createElement("dummy").style,o=["Webkit","Moz","O","ms"],c={},function(e){if(void 0===c[e]){var t=e.charAt(0).toUpperCase()+e.substr(1),n=(e+" "+o.join(t+" ")+t).split(" ");for(var i in c[e]=null,n)if(void 0!==r[n[i]]){c[e]=n[i];break}}return c[e]})};return{css3Dtransform:!(i.old||null===i.pfx("perspective")),cssTransform:!(i.old||null===i.pfx("transformOrigin")),cssTransition:!(null===i.pfx("transition")),addEventListener:!!window.addEventListener,querySelectorAll:!!document.querySelectorAll,matchMedia:!!window.matchMedia,deviceMotion:"DeviceMotionEvent"in window,deviceOrientation:"DeviceOrientationEvent"in window,contextMenu:"contextMenu"in n&&"HTMLMenuItemElement"in window,classList:"classList"in n,placeholder:"placeholder"in i.create("input"),localStorage:function(){try{return window.localStorage.setItem("featurejs-test","foobar"),window.localStorage.removeItem("featurejs-test"),!0}catch(e){return!!window.localStorage.length}}(),historyAPI:window.history&&"pushState"in window.history,serviceWorker:"serviceWorker"in t,viewportUnit:function(e){try{return e.style.width="1vw",!!(""!==e.style.width)}catch(e){return!1}}(i.create("dummy")),remUnit:function(e){try{return e.style.width="1rem",!!(""!==e.style.width)}catch(e){return!1}}(i.create("dummy")),canvas:(e=i.create("canvas"),!(!e.getContext||!e.getContext("2d"))),svg:!!document.createElementNS&&!!document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect,webGL:function(e){try{return!(!window.WebGLRenderingContext||!e.getContext("webgl")&&!e.getContext("experimental-webgl"))}catch(e){return!1}}(i.create("canvas")),cors:"XMLHttpRequest"in window&&"withCredentials"in new XMLHttpRequest,touch:!!("ontouchstart"in window||t.msPointerEnabled&&window.MSGesture||window.DocumentTouch&&document instanceof DocumentTouch),async:"async"in i.create("script"),defer:"defer"in i.create("script"),geolocation:"geolocation"in t,srcset:"srcset"in i.create("img"),sizes:"sizes"in i.create("img"),pictureElement:"HTMLPictureElement"in window,fetch:"fetch"in window,testAll:function(){var e=" js";for(var t in this)"testAll"!==t&&"extend"!==t&&this[t]&&(e+=" "+t);n.className+=e.toLowerCase()},extend:function(e,t){if("function"!=typeof t)throw new TypeError("Feature.extend: `callback` is not a Function");return this[e]=!!t(i),this}}});