-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathcaniuse.min.js
More file actions
1 lines (1 loc) · 4.42 KB
/
caniuse.min.js
File metadata and controls
1 lines (1 loc) · 4.42 KB
1
!function(t){function e(){this._createElement=function(t){return document.createElement(t)},this._createAudio=function(){return document.createElement("audio")},this._createInput=function(){return document.createElement("input")},this.browserTest=function(){console.log("browser test")},this.audio=function(){return!!this._createAudio().canPlayType},this.ogg=function(){var t=this._createAudio();return!(!t.canPlayType||!t.canPlayType('audio/ogg; codecs="vorbis"').replace(/no/,""))},this.mp3=function(){var t=this._createAudio();return!(!t.canPlayType||!t.canPlayType("audio/mpeg;").replace(/no/,""))},this.wav=function(){var t=this._createAudio();return!(!t.canPlayType||!t.canPlayType('audio/wav; codecs="1"').replace(/no/,""))},this.acc=function(){var t=this._createAudio();return!(!t.canPlayType||!t.canPlayType('audio/mp4; codecs="mp4a.40.2"').replace(/no/,""))},this.canvas=function(){return!!this._createElement("canvas").getContext},this.canvasTextApi=function(){var t=this._createElement("canvas");return t.getContext&&"function"==typeof t.getContext("2d").fillText},this.command=function(){return"type"in this._createElement("command")},this.datalist=function(){return"options"in this._createElement("datalist")},this.datails=function(){return"open"in this._createElement("details")},this.formConstraintValidation=function(){return"noValidate"in this._createElement("form")},this.iframeSandBox=function(){return"sandbox"in this._createElement("iframe")},this.iframeSrcDoc=function(){return"srcdoc"in this._createElement("iframe")},this.inputAutoFocus=function(){return"autofocus"in this._createInput()},this.inputPlaceholder=function(){return"placeholder"in this._createInput()},this.textareaPlaceholder=function(){return"placeholder"in this._createElement("textarea")},this.inputTypeColor=function(){var t=this._createInput();return t.setAttribute("type","color"),"text"!==t.type},this.inputTypeEmail=function(){var t=this._createInput();return t.setAttribute("type","email"),"text"!==t.type},this.inputTypeNumber=function(){var t=this._createInput();return t.setAttribute("type","number"),"text"!==t.type},this.inputTypeRange=function(){var t=this._createInput();return t.setAttribute("type","range"),"text"!==t.type},this.inputTypeSearch=function(){var t=this._createInput();return t.setAttribute("type","search"),"text"!==t.type},this.inputTypeTel=function(){var t=this._createInput();return t.setAttribute("type","tel"),"text"!==t.type},this.inputTypeUrl=function(){var t=this._createInput();return t.setAttribute("type","url"),"text"!==t.type},this.inputTypeDate=function(){var t=this._createInput();return t.setAttribute("type","date"),"text"!==t.type},this.inputTypeTime=function(){var t=this._createInput();return t.setAttribute("type","time"),"text"!==t.type},this.inputTypeDateTime=function(){var t=this._createInput();return t.setAttribute("type","datetime"),"text"!==t.type},this.inputDateTimeLocal=function(){var t=this._createInput();return t.setAttribute("type","datetime-local"),"text"!==t.type},this.inputTypeMonth=function(){var t=this._createElement();return t.setAttribute("type","month"),"text"!==t.type},this.inputTypeWeek=function(){var t=this._createElement();return t.setAttribute("type","week"),"text"!==t.type},this.crossDocumentMessaging=function(){return!!t.postMessage},this.dragAndDrop=function(){return"draggable"in this._createElement("span")},this.fileApi=function(){return"undefined"!=typeof FileReader},this.geolocation=function(){return!!navigator.geolocation},this.history=function(){return!(!t.history||!t.history.pushState)},this.localStorage=function(){try{return"localStorage"in t&&null!==t.localStorage}catch(e){return!1}},this.microdata=function(){return!!document.getItems},this.offlineWebApplication=function(){return!!t.applicationCache},this.serverSentEvents=function(){return"undefined"!=typeof EventSource},this.sessionStorage=function(){try{return"sessionStorage"in t&&null!==t.sessionStorage}catch(e){return!1}},this.svg=function(){return!(!document.createElementNS||!document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect)},this.svgInTextHtml=function(){var e=document.createElement("div");return e.innerHTML="<svg></svg>",!!(t.SVGSVGElement&&e.firstChild instanceof t.SVGSVGElement)},this.undo=function(){return"undefined"!=typeof UndoManager},this.indexDB=function(){return!!t.indexedDB},this.audioContextSupported=function(){return t.AudioContext=t.AudioContext||t.webkitAudioContext,t.AudioContext?!0:!1}}var n=new e;t.caniuse=n}(window);