first commit

This commit is contained in:
armansansd
2023-07-12 16:31:19 +01:00
commit 3424b1927b
23306 changed files with 2217776 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
/*!
{
"name": "Blob URLs",
"property": "bloburls",
"caniuse": "bloburls",
"notes": [{
"name": "W3C Working Draft Spec",
"href": "https://www.w3.org/TR/FileAPI/#creating-revoking"
}],
"tags": ["file", "url"],
"authors": ["Ron Waldon (@jokeyrhyme)"]
}
!*/
/* DOC
Detects support for creating Blob URLs
*/
define(['Modernizr', 'prefixed'], function(Modernizr, prefixed) {
var url = prefixed('URL', window, false);
url = url && window[url];
Modernizr.addTest('bloburls', url && 'revokeObjectURL' in url && 'createObjectURL' in url);
});
+79
View File
@@ -0,0 +1,79 @@
/*!
{
"name": "Data URI",
"property": "datauri",
"caniuse": "datauri",
"tags": ["url"],
"builderAliases": ["url_data_uri"],
"async": true,
"notes": [{
"name": "Wikipedia article",
"href": "https://en.wikipedia.org/wiki/Data_URI_scheme"
}],
"warnings": ["Support in Internet Explorer 8 is limited to images and linked resources like CSS files, not HTML files"]
}
!*/
/* DOC
Detects support for data URIs. Provides a subproperty to report support for data URIs over 32kb in size:
```javascript
Modernizr.datauri // true
Modernizr.datauri.over32kb // false in IE8
```
*/
define(['Modernizr', 'addTest'], function(Modernizr, addTest) {
// https://github.com/Modernizr/Modernizr/issues/14
Modernizr.addAsyncTest(function() {
// IE7 throw a mixed content warning on HTTPS for this test, so we'll
// just blacklist it (we know it doesn't support data URIs anyway)
// https://github.com/Modernizr/Modernizr/issues/362
if (navigator.userAgent.indexOf('MSIE 7.') !== -1) {
// Keep the test async
setTimeout(function() {
addTest('datauri', false);
}, 10);
}
var datauri = new Image();
datauri.onerror = function() {
addTest('datauri', false);
};
datauri.onload = function() {
if (datauri.width === 1 && datauri.height === 1) {
testOver32kb();
}
else {
addTest('datauri', false);
}
};
datauri.src = 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==';
// Once we have datauri, let's check to see if we can use data URIs over
// 32kb (IE8 can't). https://github.com/Modernizr/Modernizr/issues/321
function testOver32kb() {
var datauriBig = new Image();
datauriBig.onerror = function() {
addTest('datauri', true);
Modernizr.datauri = new Boolean(true);
Modernizr.datauri.over32kb = false;
};
datauriBig.onload = function() {
addTest('datauri', true);
Modernizr.datauri = new Boolean(true);
Modernizr.datauri.over32kb = (datauriBig.width === 1 && datauriBig.height === 1);
};
var base64str = 'R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==';
while (base64str.length < 33000) {
base64str = '\r\n' + base64str;
}
datauriBig.src = 'data:image/gif;base64,' + base64str;
}
});
});
+28
View File
@@ -0,0 +1,28 @@
/*!
{
"name": "URL parser",
"property": "urlparser",
"notes": [{
"name": "WHATWG Spec",
"href": "https://url.spec.whatwg.org/"
}],
"polyfills": ["urlparser"],
"authors": ["Ron Waldon (@jokeyrhyme)"],
"tags": ["url"]
}
!*/
/* DOC
Check if browser implements the URL constructor for parsing URLs.
*/
define(['Modernizr'], function(Modernizr) {
Modernizr.addTest('urlparser', function() {
var url;
try {
// have to actually try use it, because Safari defines a dud constructor
url = new URL('http://modernizr.com/');
return url.href === 'http://modernizr.com/';
} catch (e) {
return false;
}
});
});
+21
View File
@@ -0,0 +1,21 @@
/*!
{
"property": "urlsearchparams",
"tags": ["querystring", "url"],
"authors": ["Cătălin Mariș"],
"name": "URLSearchParams API",
"notes": [{
"name": "WHATWG Spec",
"href": "https://url.spec.whatwg.org/#interface-urlsearchparams"
},{
"name": "MDN Docs",
"href": "https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams"
}]
}
!*/
/* DOC
Detects support for an API that provides utility methods for working with the query string of a URL.
*/
define(['Modernizr'], function(Modernizr) {
Modernizr.addTest('urlsearchparams', 'URLSearchParams' in window);
});